diff options
author | Ronald Oussoren <ronaldoussoren@mac.com> | 2021-02-01 03:29:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-01 03:29:44 (GMT) |
commit | 49926cf2bcc8b44d9b8f148d81979ada191dd9d5 (patch) | |
tree | be9a04e3ca1007a0230b6dcf2cbab176aead735e /Lib/distutils | |
parent | a776da90b8f2a1342f4f9bfd23a62cea9a0497c6 (diff) | |
download | cpython-49926cf2bcc8b44d9b8f148d81979ada191dd9d5.zip cpython-49926cf2bcc8b44d9b8f148d81979ada191dd9d5.tar.gz cpython-49926cf2bcc8b44d9b8f148d81979ada191dd9d5.tar.bz2 |
bpo-42504: Ensure that get_config_var('MACOSX_DEPLOYMENT_TARGET') is a string (GH-24341)
* bpo-42504: Ensure that get_config_var('MACOSX_DEPLOYMENT_TARGET') is a string
Diffstat (limited to 'Lib/distutils')
-rw-r--r-- | Lib/distutils/spawn.py | 4 | ||||
-rw-r--r-- | Lib/distutils/tests/test_build_ext.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Lib/distutils/spawn.py b/Lib/distutils/spawn.py index f50edd2..0d1bd03 100644 --- a/Lib/distutils/spawn.py +++ b/Lib/distutils/spawn.py @@ -54,8 +54,8 @@ def spawn(cmd, search_path=1, verbose=0, dry_run=0): global _cfg_target, _cfg_target_split if _cfg_target is None: from distutils import sysconfig - _cfg_target = str(sysconfig.get_config_var( - 'MACOSX_DEPLOYMENT_TARGET') or '') + _cfg_target = sysconfig.get_config_var( + 'MACOSX_DEPLOYMENT_TARGET') or '' if _cfg_target: _cfg_target_split = [int(x) for x in _cfg_target.split('.')] if _cfg_target: diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py index a3055c1..90f7bb0 100644 --- a/Lib/distutils/tests/test_build_ext.py +++ b/Lib/distutils/tests/test_build_ext.py @@ -456,7 +456,7 @@ class BuildExtTestCase(TempdirManager, deptarget = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') if deptarget: # increment the minor version number (i.e. 10.6 -> 10.7) - deptarget = [int(x) for x in str(deptarget).split('.')] + deptarget = [int(x) for x in deptarget.split('.')] deptarget[-1] += 1 deptarget = '.'.join(str(i) for i in deptarget) self._try_compile_deployment_target('<', deptarget) @@ -489,7 +489,7 @@ class BuildExtTestCase(TempdirManager, # get the deployment target that the interpreter was built with target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') - target = tuple(map(int, str(target).split('.')[0:2])) + target = tuple(map(int, target.split('.')[0:2])) # format the target value as defined in the Apple # Availability Macros. We can't use the macro names since # at least one value we test with will not exist yet. |