Skip to content

Commit 8a95851

Browse files
committed
updated patch for setuptools
1 parent 99ed001 commit 8a95851

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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

Comments
 (0)