Commit b32e869e authored by Xavier de Gaye's avatar Xavier de Gaye

Issue #28046: Fix get_sysconfigdata_name().

parent d07b66b8
...@@ -342,12 +342,19 @@ def get_makefile_filename(): ...@@ -342,12 +342,19 @@ def get_makefile_filename():
return os.path.join(get_path('stdlib'), config_dir_name, 'Makefile') return os.path.join(get_path('stdlib'), config_dir_name, 'Makefile')
def _get_sysconfigdata_name(): def _get_sysconfigdata_name(vars=None):
return '_sysconfigdata_{abi}_{platform}_{multiarch}'.format( if vars is None:
abi=sys.abiflags, return '_sysconfigdata_{abi}_{platform}_{multiarch}'.format(
platform=sys.platform, abi=sys.abiflags,
multiarch=getattr(sys.implementation, '_multiarch', ''), 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(): def _generate_posix_vars():
...@@ -390,7 +397,7 @@ def _generate_posix_vars(): ...@@ -390,7 +397,7 @@ def _generate_posix_vars():
# _sysconfigdata module manually and populate it with the build vars. # _sysconfigdata module manually and populate it with the build vars.
# This is more than sufficient for ensuring the subsequent call to # This is more than sufficient for ensuring the subsequent call to
# get_platform() succeeds. # get_platform() succeeds.
name = _get_sysconfigdata_name() name = _get_sysconfigdata_name(vars)
if 'darwin' in sys.platform: if 'darwin' in sys.platform:
import types import types
module = types.ModuleType(name) module = types.ModuleType(name)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment