summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Weber <bryan.w.weber@gmail.com>2022-04-18 21:01:18 (GMT)
committerGitHub <noreply@github.com>2022-04-18 21:01:18 (GMT)
commit0860b26a4f7abeb61aad9f4b96de8e78eed8c12a (patch)
tree53d06cd23ba463b1d4473ebee34310bcc10e0eec
parent2f0fc521f48af0dcec86dfcc8d0bc91eebf974ee (diff)
downloadcpython-0860b26a4f7abeb61aad9f4b96de8e78eed8c12a.zip
cpython-0860b26a4f7abeb61aad9f4b96de8e78eed8c12a.tar.gz
cpython-0860b26a4f7abeb61aad9f4b96de8e78eed8c12a.tar.bz2
gh-91670: Removes `SO` config variable in `sysconfig.py` (#91671)
* Removes SO config variable in sysconfig Per @warsaw in https://github.com/python/cpython/issues/63754, this was deprecated in Python 3.4 and was suggested for removal in Python 3.5. * Add NEWS * Update Misc/NEWS.d/next/Library/2022-04-18-15-23-24.gh-issue-91670.6eyChw.rst Co-authored-by: Éric <merwok@netwok.org> Co-authored-by: Barry Warsaw <barry@python.org> Co-authored-by: Éric <merwok@netwok.org>
-rw-r--r--Lib/distutils/tests/test_sysconfig.py20
-rw-r--r--Lib/sysconfig.py7
-rw-r--r--Lib/test/test_sysconfig.py15
-rw-r--r--Misc/NEWS.d/next/Library/2022-04-18-15-23-24.gh-issue-91670.6eyChw.rst1
4 files changed, 1 insertions, 42 deletions
diff --git a/Lib/distutils/tests/test_sysconfig.py b/Lib/distutils/tests/test_sysconfig.py
index 7a88c88..e7d435f 100644
--- a/Lib/distutils/tests/test_sysconfig.py
+++ b/Lib/distutils/tests/test_sysconfig.py
@@ -227,26 +227,6 @@ class SysconfigTestCase(support.EnvironGuard, unittest.TestCase):
self.assertEqual(global_sysconfig.get_config_var('CC'),
sysconfig.get_config_var('CC'))
- @unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None,
- 'EXT_SUFFIX required for this test')
- def test_SO_deprecation(self):
- self.assertWarns(DeprecationWarning,
- sysconfig.get_config_var, 'SO')
-
- @unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None,
- 'EXT_SUFFIX required for this test')
- def test_SO_value(self):
- with check_warnings(('', DeprecationWarning)):
- self.assertEqual(sysconfig.get_config_var('SO'),
- sysconfig.get_config_var('EXT_SUFFIX'))
-
- @unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None,
- 'EXT_SUFFIX required for this test')
- def test_SO_in_vars(self):
- vars = sysconfig.get_config_vars()
- self.assertIsNotNone(vars['SO'])
- self.assertEqual(vars['SO'], vars['EXT_SUFFIX'])
-
@requires_subprocess()
def test_customize_compiler_before_get_config_vars(self):
# Issue #21923: test that a Distribution compiler
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index 2a01342..e21b730 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -667,10 +667,6 @@ def get_config_vars(*args):
_CONFIG_VARS['VPATH'] = sys._vpath
if os.name == 'posix':
_init_posix(_CONFIG_VARS)
- # For backward compatibility, see issue19555
- SO = _CONFIG_VARS.get('EXT_SUFFIX')
- if SO is not None:
- _CONFIG_VARS['SO'] = SO
if _HAS_USER_BASE:
# Setting 'userbase' is done below the call to the
# init function to enable using 'get_config_var' in
@@ -715,9 +711,6 @@ def get_config_var(name):
Equivalent to get_config_vars().get(name)
"""
- if name == 'SO':
- import warnings
- warnings.warn('SO is deprecated, use EXT_SUFFIX', DeprecationWarning, 2)
return get_config_vars().get(name)
diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py
index c7ec78f..f2b9370 100644
--- a/Lib/test/test_sysconfig.py
+++ b/Lib/test/test_sysconfig.py
@@ -465,26 +465,11 @@ class TestSysConfig(unittest.TestCase):
@unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None,
'EXT_SUFFIX required for this test')
- def test_SO_deprecation(self):
- self.assertWarns(DeprecationWarning,
- sysconfig.get_config_var, 'SO')
-
- @unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None,
- 'EXT_SUFFIX required for this test')
- def test_SO_value(self):
- with check_warnings(('', DeprecationWarning)):
- self.assertEqual(sysconfig.get_config_var('SO'),
- sysconfig.get_config_var('EXT_SUFFIX'))
-
- @unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None,
- 'EXT_SUFFIX required for this test')
def test_EXT_SUFFIX_in_vars(self):
import _imp
if not _imp.extension_suffixes():
self.skipTest("stub loader has no suffixes")
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
diff --git a/Misc/NEWS.d/next/Library/2022-04-18-15-23-24.gh-issue-91670.6eyChw.rst b/Misc/NEWS.d/next/Library/2022-04-18-15-23-24.gh-issue-91670.6eyChw.rst
new file mode 100644
index 0000000..38ba32d
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2022-04-18-15-23-24.gh-issue-91670.6eyChw.rst
@@ -0,0 +1 @@
+Remove deprecated ``SO`` config variable in :mod:`sysconfig`.