diff options
author | Xavier de Gaye <xdegaye@users.sourceforge.net> | 2016-09-10 14:19:45 (GMT) |
---|---|---|
committer | Xavier de Gaye <xdegaye@users.sourceforge.net> | 2016-09-10 14:19:45 (GMT) |
commit | b32e869eb1f63907c54aacf725601d637f1171c1 (patch) | |
tree | 729178bd816c2971093b710950e10fbe2033544f /Lib/sysconfig.py | |
parent | d07b66b817dab9fb90e6b8af84cdbe983b7d2d29 (diff) | |
download | cpython-b32e869eb1f63907c54aacf725601d637f1171c1.zip cpython-b32e869eb1f63907c54aacf725601d637f1171c1.tar.gz cpython-b32e869eb1f63907c54aacf725601d637f1171c1.tar.bz2 |
Issue #28046: Fix get_sysconfigdata_name().
Diffstat (limited to 'Lib/sysconfig.py')
-rw-r--r-- | Lib/sysconfig.py | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py index c2f28f5..13275de 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -342,12 +342,19 @@ def get_makefile_filename(): return os.path.join(get_path('stdlib'), config_dir_name, 'Makefile') -def _get_sysconfigdata_name(): - return '_sysconfigdata_{abi}_{platform}_{multiarch}'.format( - abi=sys.abiflags, - platform=sys.platform, - multiarch=getattr(sys.implementation, '_multiarch', ''), - ) +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 _generate_posix_vars(): @@ -390,7 +397,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() + name = _get_sysconfigdata_name(vars) if 'darwin' in sys.platform: import types module = types.ModuleType(name) |