1 From bcddbf40c7f1b80336268cdddacc17369fb0ccea Mon Sep 17 00:00:00 2001
2 From: Libin Dang <libin.dang@windriver.com>
3 Date: Tue, 11 Apr 2017 14:12:15 +0800
4 Subject: [PATCH] Issue #21272: Use _sysconfigdata.py to initialize
7 Backport upstream commit
8 https://github.com/python/cpython/commit/409482251b06fe75c4ee56e85ffbb4b23d934159
10 Upstream-Status: Backport
12 Signed-off-by: Li Zhou <li.zhou@windriver.com>
14 Lib/distutils/sysconfig.py | 35 ++++-------------------------------
15 1 file changed, 4 insertions(+), 31 deletions(-)
17 diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
18 index 6d5cfd0..9925d24 100644
19 --- a/Lib/distutils/sysconfig.py
20 +++ b/Lib/distutils/sysconfig.py
21 @@ -424,38 +424,11 @@ _config_vars = None
24 """Initialize the module as appropriate for POSIX systems."""
26 - # load the installed Makefile:
28 - filename = get_makefile_filename()
29 - parse_makefile(filename, g)
30 - except OSError as msg:
31 - my_msg = "invalid Python installation: unable to open %s" % filename
32 - if hasattr(msg, "strerror"):
33 - my_msg = my_msg + " (%s)" % msg.strerror
35 - raise DistutilsPlatformError(my_msg)
37 - # load the installed pyconfig.h:
39 - filename = get_config_h_filename()
40 - with open(filename) as file:
41 - parse_config_h(file, g)
42 - except OSError as msg:
43 - my_msg = "invalid Python installation: unable to open %s" % filename
44 - if hasattr(msg, "strerror"):
45 - my_msg = my_msg + " (%s)" % msg.strerror
47 - raise DistutilsPlatformError(my_msg)
49 - # On AIX, there are wrong paths to the linker scripts in the Makefile
50 - # -- these paths are relative to the Python source, but when installed
51 - # the scripts are in another directory.
53 - g['LDSHARED'] = g['BLDSHARED']
55 + # _sysconfigdata is generated at build time, see the sysconfig module
56 + from _sysconfigdata import build_time_vars
60 + _config_vars.update(build_time_vars)