summaryrefslogtreecommitdiff
path: root/django/template
diff options
context:
space:
mode:
authorChris Lamb <chris@chris-lamb.co.uk>2015-11-18 20:40:08 +0200
committerTim Graham <timograham@gmail.com>2015-11-19 11:11:21 -0500
commitb15eaa2963a32b00e77f1dc2c04ce0ddb918496a (patch)
tree3074fc572115c3b0ebf3369ca92dad5d2ac6723e /django/template
parent95eca4f508eb99d26ce812629afe0f6c60488134 (diff)
[1.8.x] Corrected stacklevel in Engine deprecation warnings.
Otherwise we just see django.template.loader and not the "original" callers. Backport of ed9509156195e6952ec1a5de4f9360e5f028caa2 from stable/1.9.x
Diffstat (limited to 'django/template')
-rw-r--r--django/template/engine.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/django/template/engine.py b/django/template/engine.py
index f6547ac3e1..365fb12ddb 100644
--- a/django/template/engine.py
+++ b/django/template/engine.py
@@ -185,7 +185,7 @@ class Engine(object):
else:
warnings.warn(
"The context_instance argument of render_to_string is "
- "deprecated.", RemovedInDjango110Warning, stacklevel=2)
+ "deprecated.", RemovedInDjango110Warning, stacklevel=3)
if dirs is _dirs_undefined:
# Do not set dirs to None here to avoid triggering the deprecation
# warning in select_template or get_template.
@@ -193,13 +193,13 @@ class Engine(object):
else:
warnings.warn(
"The dirs argument of render_to_string is deprecated.",
- RemovedInDjango110Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=3)
if dictionary is _dictionary_undefined:
dictionary = None
else:
warnings.warn(
"The dictionary argument of render_to_string was renamed to "
- "context.", RemovedInDjango110Warning, stacklevel=2)
+ "context.", RemovedInDjango110Warning, stacklevel=3)
context = dictionary
if isinstance(template_name, (list, tuple)):
@@ -231,7 +231,7 @@ class Engine(object):
else:
warnings.warn(
"The dirs argument of select_template is deprecated.",
- RemovedInDjango110Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=3)
if not template_name_list:
raise TemplateDoesNotExist("No template names provided")