Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-39825: fix sysconfig.get_config_var('EXT_SUFFIX') on windows #22088

Merged
merged 2 commits into from
Dec 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Lib/sysconfig.py
Original file line number Diff line number Diff line change
@@ -424,10 +424,11 @@ def _init_posix(vars):
def _init_non_posix(vars):
"""Initialize the module as appropriate for NT"""
# set basic install directories
import _imp
vars['LIBDEST'] = get_path('stdlib')
vars['BINLIBDEST'] = get_path('platstdlib')
vars['INCLUDEPY'] = get_path('include')
vars['EXT_SUFFIX'] = '.pyd'
vars['EXT_SUFFIX'] = _imp.extension_suffixes()[0]
vars['EXE'] = '.exe'
vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT
vars['BINDIR'] = os.path.dirname(_safe_realpath(sys.executable))
4 changes: 3 additions & 1 deletion Lib/test/test_sysconfig.py
Original file line number Diff line number Diff line change
@@ -360,10 +360,12 @@ def test_SO_value(self):

@unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None,
'EXT_SUFFIX required for this test')
def test_SO_in_vars(self):
def test_EXT_SUFFIX_in_vars(self):
import _imp
vars = sysconfig.get_config_vars()
self.assertIsNotNone(vars['SO'])
self.assertEqual(vars['SO'], vars['EXT_SUFFIX'])
self.assertEqual(vars['EXT_SUFFIX'], _imp.extension_suffixes()[0])

@unittest.skipUnless(sys.platform == 'linux' and
hasattr(sys.implementation, '_multiarch'),
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Windows: Change ``sysconfig.get_config_var('EXT_SUFFIX')`` to the expected
full ``platform_tag.extension`` format. Previously it was hard-coded to
``.pyd``, now it is compatible with ``distutils.sysconfig`` and will result
in something like ``.cp38-win_amd64.pyd``. This brings windows into
conformance with the other platforms.