From: David Lord Date: Fri, 14 May 2021 00:48:19 +0000 (-0700) Subject: show context for deprecated extensions X-Git-Tag: 3.0.1~4^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4d31e7b8df2cd9f42e6dc28c5f7d82fe8767110;p=thirdparty%2Fjinja.git show context for deprecated extensions --- diff --git a/CHANGES.rst b/CHANGES.rst index bc05ed49..b1835228 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -9,6 +9,8 @@ Unreleased - Mark top-level names as exported so type checking understands imports in user projects. :issue:`1426` - Fix some types that weren't available in Python 3.6.0. :issue:`1433` +- The deprecation warning for unneeded ``autoescape`` and ``with_`` + extensions shows more relevant context. :issue:`1429` Version 3.0.0 diff --git a/src/jinja2/ext.py b/src/jinja2/ext.py index 9c5498be..3e982930 100644 --- a/src/jinja2/ext.py +++ b/src/jinja2/ext.py @@ -604,7 +604,7 @@ class WithExtension(Extension): "The 'with' extension is deprecated and will be removed in" " Jinja 3.1. This is built in now.", DeprecationWarning, - stacklevel=2, + stacklevel=3, ) @@ -615,7 +615,7 @@ class AutoEscapeExtension(Extension): "The 'autoescape' extension is deprecated and will be" " removed in Jinja 3.1. This is built in now.", DeprecationWarning, - stacklevel=2, + stacklevel=3, )