Skip to content

Commit 6391b16

Browse files
committed
Fix ensurepip on posix
1 parent bd116e1 commit 6391b16

File tree

1 file changed

+4
-31
lines changed

1 file changed

+4
-31
lines changed

Src/StdLib/Lib/distutils/sysconfig.py

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -424,38 +424,11 @@ def expand_makefile_vars(s, vars):
424424

425425
def _init_posix():
426426
"""Initialize the module as appropriate for POSIX systems."""
427-
g = {}
428-
# load the installed Makefile:
429-
try:
430-
filename = get_makefile_filename()
431-
parse_makefile(filename, g)
432-
except OSError as msg:
433-
my_msg = "invalid Python installation: unable to open %s" % filename
434-
if hasattr(msg, "strerror"):
435-
my_msg = my_msg + " (%s)" % msg.strerror
436-
437-
raise DistutilsPlatformError(my_msg)
438-
439-
# load the installed pyconfig.h:
440-
try:
441-
filename = get_config_h_filename()
442-
with open(filename) as file:
443-
parse_config_h(file, g)
444-
except OSError as msg:
445-
my_msg = "invalid Python installation: unable to open %s" % filename
446-
if hasattr(msg, "strerror"):
447-
my_msg = my_msg + " (%s)" % msg.strerror
448-
449-
raise DistutilsPlatformError(my_msg)
450-
451-
# On AIX, there are wrong paths to the linker scripts in the Makefile
452-
# -- these paths are relative to the Python source, but when installed
453-
# the scripts are in another directory.
454-
if python_build:
455-
g['LDSHARED'] = g['BLDSHARED']
456-
427+
# _sysconfigdata is generated at build time, see the sysconfig module
428+
from _sysconfigdata import build_time_vars # ironpython
457429
global _config_vars
458-
_config_vars = g
430+
_config_vars = {}
431+
_config_vars.update(build_time_vars)
459432

460433

461434
def _init_nt():

0 commit comments

Comments
 (0)