Skip to content

Commit 5bfa945

Browse files
authored
bpo-41282: distutils: Fix stacklevel for DeprecationWarning (GH-24657)
DeprecationWarning is emit for `import distutils`, not for `distutils` itself.
1 parent a347bc0 commit 5bfa945

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Lib/distutils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
warnings.warn("The distutils package is deprecated and slated for "
1717
"removal in Python 3.12. Use setuptools or check "
1818
"PEP 632 for potential alternatives",
19-
DeprecationWarning)
19+
DeprecationWarning, 2)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fixed stacklevel of ``DeprecationWarning`` emitted from ``import
2+
distutils``.

0 commit comments

Comments
 (0)