diff options
author | Xavier de Gaye <xdegaye@users.sourceforge.net> | 2016-09-11 20:22:24 (GMT) |
---|---|---|
committer | Xavier de Gaye <xdegaye@users.sourceforge.net> | 2016-09-11 20:22:24 (GMT) |
commit | 92dec548ff1494b86f08bd3753ca91a9330b4ea9 (patch) | |
tree | f45ab78e107ff109cc7e7c2e45b966a684500ede /Lib/sysconfig.py | |
parent | ef71d2054835029fe54d577c154c43d2a5856d2f (diff) | |
download | cpython-92dec548ff1494b86f08bd3753ca91a9330b4ea9.zip cpython-92dec548ff1494b86f08bd3753ca91a9330b4ea9.tar.gz cpython-92dec548ff1494b86f08bd3753ca91a9330b4ea9.tar.bz2 |
Issue #28046: get_sysconfigdata_name() uses the _PYTHON_SYSCONFIGDATA_NAME
environment variable that is defined when cross-compiling.
Diffstat (limited to 'Lib/sysconfig.py')
-rw-r--r-- | Lib/sysconfig.py | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py index 13275de..9314e71 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -342,19 +342,13 @@ def get_makefile_filename(): return os.path.join(get_path('stdlib'), config_dir_name, 'Makefile') -def _get_sysconfigdata_name(vars=None): - if vars is None: - return '_sysconfigdata_{abi}_{platform}_{multiarch}'.format( - abi=sys.abiflags, - platform=sys.platform, - multiarch=getattr(sys.implementation, '_multiarch', ''), - ) - else: - return '_sysconfigdata_{abi}_{platform}_{multiarch}'.format( - abi=vars['ABIFLAGS'], - platform=vars['MACHDEP'], - multiarch=vars.get('MULTIARCH', ''), - ) +def _get_sysconfigdata_name(): + return os.environ.get('_PYTHON_SYSCONFIGDATA_NAME', + '_sysconfigdata_{abi}_{platform}_{multiarch}'.format( + abi=sys.abiflags, + platform=sys.platform, + multiarch=getattr(sys.implementation, '_multiarch', ''), + )) def _generate_posix_vars(): @@ -397,7 +391,7 @@ def _generate_posix_vars(): # _sysconfigdata module manually and populate it with the build vars. # This is more than sufficient for ensuring the subsequent call to # get_platform() succeeds. - name = _get_sysconfigdata_name(vars) + name = _get_sysconfigdata_name() if 'darwin' in sys.platform: import types module = types.ModuleType(name) |