Skip to content

Commit b4d31e7

Browse files
committed
show context for deprecated extensions
1 parent 426c560 commit b4d31e7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Unreleased
99
- Mark top-level names as exported so type checking understands
1010
imports in user projects. :issue:`1426`
1111
- Fix some types that weren't available in Python 3.6.0. :issue:`1433`
12+
- The deprecation warning for unneeded ``autoescape`` and ``with_``
13+
extensions shows more relevant context. :issue:`1429`
1214

1315

1416
Version 3.0.0

src/jinja2/ext.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ def __init__(self, environment: Environment) -> None:
604604
"The 'with' extension is deprecated and will be removed in"
605605
" Jinja 3.1. This is built in now.",
606606
DeprecationWarning,
607-
stacklevel=2,
607+
stacklevel=3,
608608
)
609609

610610

@@ -615,7 +615,7 @@ def __init__(self, environment: Environment) -> None:
615615
"The 'autoescape' extension is deprecated and will be"
616616
" removed in Jinja 3.1. This is built in now.",
617617
DeprecationWarning,
618-
stacklevel=2,
618+
stacklevel=3,
619619
)
620620

621621

0 commit comments

Comments
 (0)