From 2c84506cf01ff841b6d85d74eb7f3aca05230cbb Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Fri, 26 Feb 2021 13:23:01 +0900 Subject: [PATCH 1/2] bpo-41282: distutils: Fix stacklevel for DeprecationWarning --- Lib/distutils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/distutils/__init__.py b/Lib/distutils/__init__.py index 7b2b059b83dad1..8eef902f7d6204 100644 --- a/Lib/distutils/__init__.py +++ b/Lib/distutils/__init__.py @@ -16,4 +16,4 @@ warnings.warn("The distutils package is deprecated and slated for " "removal in Python 3.12. Use setuptools or check " "PEP 632 for potential alternatives", - DeprecationWarning) + DeprecationWarning, 2) From 96a9a351bdc9f21a06698f55dff8c707220a2037 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 2 Mar 2021 09:54:25 +0900 Subject: [PATCH 2/2] Add news entry --- .../next/Library/2021-03-02-09-54-22.bpo-41282.xL4h94.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2021-03-02-09-54-22.bpo-41282.xL4h94.rst diff --git a/Misc/NEWS.d/next/Library/2021-03-02-09-54-22.bpo-41282.xL4h94.rst b/Misc/NEWS.d/next/Library/2021-03-02-09-54-22.bpo-41282.xL4h94.rst new file mode 100644 index 00000000000000..6655ac69c44af3 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-02-09-54-22.bpo-41282.xL4h94.rst @@ -0,0 +1,2 @@ +Fixed stacklevel of ``DeprecationWarning`` emitted from ``import +distutils``.