Skip to content

Commit

Permalink
Disable 'SETUPTOOLS_USE_DISTUTILS=stdlib' on Python 3.12+
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Jun 12, 2023
1 parent e24a700 commit df91a74
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions _distutils_hack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ def enabled():
Allow selection of distutils by environment variable.
"""
which = os.environ.get('SETUPTOOLS_USE_DISTUTILS', 'local')
if which != 'local' and sys.version_info >= (3, 12):
import warnings

warnings.warn("Cannot use `SETUPTOOLS_USE_DISTUTILS=stdlib` on Python 3.12+")
return True
return which == 'local'


Expand Down
1 change: 1 addition & 0 deletions changelog.d/3952.change.3.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Disable ``SETUPTOOLS_USE_DISTUTILS=stdlib`` on Python >= 3.12.

0 comments on commit df91a74

Please sign in to comment.