Index: Lib/_osx_support.py
===================================================================
--- Lib/_osx_support.py.orig
@@ -444,8 +444,16 @@ def get_platform_osx(_config_vars, osnam
# case and disallow installs.
cflags = _config_vars.get(_INITPRE+'CFLAGS',
_config_vars.get('CFLAGS', ''))
- if ((macrelease + '.') >= '10.4.' and
- '-arch' in cflags.strip()):
+ macrelease = tuple(int(i) for i in macrelease.split('.')[0:2])
+ # assume no universal support
+ if (macrelease >= (10, 4)) and '-arch' in cflags.strip():
# The universal build will build fat binaries, but not on
Index: Lib/distutils/tests/test_build_ext.py
===================================================================
--- Lib/distutils/tests/test_build_ext.py.orig
+++ Lib/distutils/tests/test_build_ext.py
@@ -448,8 +448,16 @@ 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, target.split('.')))
- target = '%02d%01d0' % target
+ 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.
+ # for 10.1 through 10.9.x -> "10n0"
+ target = '%02d%01d0' % target
+ # for 10.10 and beyond -> "10nn00"
+ target = '%02d%02d00' % target
deptarget_ext = Extension(
Index: Lib/test/test__osx_support.py
===================================================================
--- Lib/test/test__osx_support.py.orig
+++ Lib/test/test__osx_support.py
@@ -109,7 +109,9 @@ class Test_OSXSupport(unittest.TestCase)
def test__supports_universal_builds(self):
- self.assertEqual(platform.mac_ver()[0].split('.') >= ['10', '4'],
+ mac_ver_tuple = tuple(int(i) for i in
+ platform.mac_ver()[0].split('.')[0:2])
+ self.assertEqual(mac_ver_tuple >= (10, 4),
_osx_support._supports_universal_builds())
def test__find_appropriate_compiler(self):
Index: Lib/test/test_posix.py
===================================================================