Skip to content

Commit 18cd2c9

Browse files
committed
revert patch to ensurepip and instead patch platform.libc_ver to give up when we cannot open the executable
1 parent 715f8b5 commit 18cd2c9

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

graalpython/lib-python/3/ensurepip/__init__.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@ def _run_pip(args, additional_paths=None):
2323
if additional_paths is not None:
2424
sys.path = additional_paths + sys.path
2525

26-
# Truffle patch: begin
27-
import platform
28-
29-
def libc_ver(executable=sys.executable, lib='', version='', chunksize=16384):
30-
return lib, None
31-
setattr(platform, 'libc_ver', libc_ver)
32-
# End Truffle patch
33-
3426
# Install the bundled software
3527
import pip._internal
3628
return pip._internal.main(args)

graalpython/lib-python/3/platform.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ def libc_ver(executable=sys.executable, lib='', version='',
161161
The file is read and scanned in chunks of chunksize bytes.
162162
163163
"""
164+
if sys.implementation.name == "graalpython":
165+
if executable == sys.executable and not os.path.exists(executable):
166+
return lib, version
164167
if hasattr(os.path, 'realpath'):
165168
# Python 2.2 introduced os.path.realpath(); it is used
166169
# here to work around problems with Cygwin not being

0 commit comments

Comments
 (0)