bpo-41282: Add deprecation warning and docs for distutils (PEP 632) by zooba · Pull Request #24355 · python/cpython (original) (raw)

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation4 Commits3 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

zooba

@zooba

merwok

@zooba

@zooba

@methane

I see this warning is emit for distutils/__init__.py.

/Users/inada-n/work/python/cpython/Lib/distutils/__init__.py:16: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives

How about adding stacklevel to emit warning for modules importing distutils?

patch:

--- 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)

warning:

/Users/inada-n/work/python/cpython/./setup.py:33: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives

PR: #24657

adorilson pushed a commit to adorilson/cpython that referenced this pull request

Mar 13, 2021

@zooba @adorilson