summaryrefslogtreecommitdiff
path: root/dev-python/django/files/django-4.2.3-py312.patch
blob: 7989f8e7cbccd8ef5fdef719e9e2f9b12e839597 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
This is a hack to get the tests to pass prior to:

[e83a88566a71a2353cebc35992c110be0f8628af] Fixed #32172 -- Adapted signals to allow async handlers.

diff --git a/django/test/signals.py b/django/test/signals.py
index 94a5161e82..1358101b98 100644
--- a/django/test/signals.py
+++ b/django/test/signals.py
@@ -14,6 +14,7 @@ from django.utils import timezone
 from django.utils.formats import FORMAT_SETTINGS, reset_format_cache
 from django.utils.functional import empty
 from django.utils.module_loading import import_string
+from django.utils.version import PY312
 
 template_rendered = Signal()
 
@@ -183,7 +184,7 @@ def complex_setting_changed(*, enter, setting, **kwargs):
         # this stacklevel shows the line containing the override_settings call.
         warnings.warn(
             f"Overriding setting {setting} can lead to unexpected behavior.",
-            stacklevel=6,
+            stacklevel=5 if PY312 else 6,
         )