diff options
author | Filipe LaĆns <lains@riseup.net> | 2022-11-19 20:47:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-19 20:47:09 (GMT) |
commit | b0e1f9c241cd8f8c864d51059217f997d3b792bf (patch) | |
tree | 8fa4619264acd25020948fe7072a9d21f4a29288 /Lib/sysconfig.py | |
parent | 858cb79486b504b2645c1ee3bfdca4f386bcb7d7 (diff) | |
download | cpython-b0e1f9c241cd8f8c864d51059217f997d3b792bf.zip cpython-b0e1f9c241cd8f8c864d51059217f997d3b792bf.tar.gz cpython-b0e1f9c241cd8f8c864d51059217f997d3b792bf.tar.bz2 |
gh-99201: fix IndexError when initializing sysconfig config variables
Diffstat (limited to 'Lib/sysconfig.py')
-rw-r--r-- | Lib/sysconfig.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py index 73c2568..c61100a 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -544,7 +544,12 @@ def _init_non_posix(vars): vars['LIBDEST'] = get_path('stdlib') vars['BINLIBDEST'] = get_path('platstdlib') vars['INCLUDEPY'] = get_path('include') - vars['EXT_SUFFIX'] = _imp.extension_suffixes()[0] + try: + # GH-99201: _imp.extension_suffixes may be empty when + # HAVE_DYNAMIC_LOADING is not set. In this case, don't set EXT_SUFFIX. + vars['EXT_SUFFIX'] = _imp.extension_suffixes()[0] + except IndexError: + pass vars['EXE'] = '.exe' vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT vars['BINDIR'] = os.path.dirname(_safe_realpath(sys.executable)) |