bpo-41282: distutils: Fix stacklevel for DeprecationWarning (GH-24657) · python/cpython@5bfa945 (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Commit 5bfa945

bpo-41282: distutils: Fix stacklevel for DeprecationWarning (GH-24657)

DeprecationWarning is emit for `import distutils`, not for `distutils` itself.

File tree

2 files changed

lines changed

2 files changed

lines changed

Lines changed: 1 addition & 1 deletion

Original file line number Diff line number Diff line change
@@ -16,4 +16,4 @@
16 16 warnings.warn("The distutils package is deprecated and slated for "
17 17 "removal in Python 3.12. Use setuptools or check "
18 18 "PEP 632 for potential alternatives",
19 -DeprecationWarning)
19 +DeprecationWarning, 2)

Lines changed: 2 additions & 0 deletions

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1 +Fixed stacklevel of ``DeprecationWarning`` emitted from ``import
2 +distutils``.