|
| 1 | +diff -r -u a/_distutils_hack/__init__.py b/_distutils_hack/__init__.py |
| 2 | +--- a/_distutils_hack/__init__.py 2022-06-17 21:46:23.000000000 +0200 |
| 3 | ++++ b/_distutils_hack/__init__.py 2022-07-29 10:37:40.000000000 +0200 |
| 4 | +@@ -44,7 +44,9 @@ |
| 5 | + """ |
| 6 | + Allow selection of distutils by environment variable. |
| 7 | + """ |
| 8 | +- which = os.environ.get('SETUPTOOLS_USE_DISTUTILS', 'local') |
| 9 | ++ # which = os.environ.get('SETUPTOOLS_USE_DISTUTILS', 'local') |
| 10 | ++ # GraalVM change: default to stdlib |
| 11 | ++ which = os.environ.get('SETUPTOOLS_USE_DISTUTILS', 'stdlib') |
| 12 | + return which == 'local' |
| 13 | + |
| 14 | + |
| 15 | +@@ -200,7 +202,8 @@ |
| 16 | + |
| 17 | + |
| 18 | + def add_shim(): |
| 19 | +- DISTUTILS_FINDER in sys.meta_path or insert_shim() |
| 20 | ++ if enabled(): |
| 21 | ++ DISTUTILS_FINDER in sys.meta_path or insert_shim() |
| 22 | + |
| 23 | + |
| 24 | + class shim: |
| 25 | +@@ -212,7 +215,8 @@ |
| 26 | + |
| 27 | + |
| 28 | + def insert_shim(): |
| 29 | +- sys.meta_path.insert(0, DISTUTILS_FINDER) |
| 30 | ++ if enabled(): |
| 31 | ++ sys.meta_path.insert(0, DISTUTILS_FINDER) |
| 32 | + |
| 33 | + |
| 34 | + def remove_shim(): |
| 35 | +diff -r -u a/setuptools/_vendor/importlib_metadata/_compat.py b/setuptools/_vendor/importlib_metadata/_compat.py |
| 36 | +--- a/setuptools/_vendor/importlib_metadata/_compat.py 2022-06-17 21:46:23.000000000 +0200 |
| 37 | ++++ b/setuptools/_vendor/importlib_metadata/_compat.py 2022-07-29 10:56:09.000000000 +0200 |
| 38 | +@@ -36,7 +36,7 @@ |
| 39 | + def matches(finder): |
| 40 | + return getattr( |
| 41 | + finder, '__module__', None |
| 42 | +- ) == '_frozen_importlib_external' and hasattr(finder, 'find_distributions') |
| 43 | ++ ) in ('_frozen_importlib_external', 'importlib._bootstrap_external') and hasattr(finder, 'find_distributions') |
| 44 | + |
| 45 | + for finder in filter(matches, sys.meta_path): # pragma: nocover |
| 46 | + del finder.find_distributions |
0 commit comments