summaryrefslogtreecommitdiff
path: root/django/test
diff options
context:
space:
mode:
authorAdam Chainz <me@adamj.eu>2016-11-22 14:30:14 +0000
committerTim Graham <timograham@gmail.com>2016-11-22 09:30:14 -0500
commit22a60f8d0b331bf06c066ccba4eea5bb5e4ac9f2 (patch)
tree4c65205d4d715b253cdf9b114a8092d18d46089b /django/test
parentc70ffeeb8b70b42693a340724f00eba656c6e51a (diff)
Fixed #27513 -- Made Signal.send()/send_robust() a tiny bit faster.
Diffstat (limited to 'django/test')
-rw-r--r--django/test/signals.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/django/test/signals.py b/django/test/signals.py
index 70b20625ff..98506609e1 100644
--- a/django/test/signals.py
+++ b/django/test/signals.py
@@ -8,7 +8,7 @@ from django.core.signals import setting_changed
from django.db import connections, router
from django.db.utils import ConnectionRouter
from django.dispatch import Signal, receiver
-from django.utils import timezone
+from django.utils import six, timezone
from django.utils.functional import empty
template_rendered = Signal(providing_args=["template", "context"])
@@ -127,9 +127,9 @@ def file_storage_changed(**kwargs):
def complex_setting_changed(**kwargs):
if kwargs['enter'] and kwargs['setting'] in COMPLEX_OVERRIDE_SETTINGS:
# Considering the current implementation of the signals framework,
- # stacklevel=5 shows the line containing the override_settings call.
+ # this stacklevel shows the line containing the override_settings call.
warnings.warn("Overriding setting %s can lead to unexpected behavior."
- % kwargs['setting'], stacklevel=5)
+ % kwargs['setting'], stacklevel=5 if six.PY2 else 6)
@receiver(setting_changed)