summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2014-06-25 20:36:14 (GMT)
committerNed Deily <nad@acm.org>2014-06-25 20:36:14 (GMT)
commit04cdfa1147d5aadbee190b3aa2c4ccfd2d4a122d (patch)
tree3f7582d80bbbd7f46f39e78954e2b8e1c4b63359 /Lib
parent975735f729df6b7767556d2d389b560dbc7500ac (diff)
downloadcpython-04cdfa1147d5aadbee190b3aa2c4ccfd2d4a122d.zip
cpython-04cdfa1147d5aadbee190b3aa2c4ccfd2d4a122d.tar.gz
cpython-04cdfa1147d5aadbee190b3aa2c4ccfd2d4a122d.tar.bz2
Issue #21811: Anticipated fixes to 3.x and 2.7 for OS X 10.10 Yosemite.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/_osx_support.py12
-rw-r--r--Lib/distutils/tests/test_build_ext.py12
-rw-r--r--Lib/test/test__osx_support.py4
-rw-r--r--Lib/test/test_posix.py2
4 files changed, 24 insertions, 6 deletions
diff --git a/Lib/_osx_support.py b/Lib/_osx_support.py
index b6eac5f..b07e75d 100644
--- a/Lib/_osx_support.py
+++ b/Lib/_osx_support.py
@@ -450,8 +450,16 @@ def get_platform_osx(_config_vars, osname, release, machine):
# case and disallow installs.
cflags = _config_vars.get(_INITPRE+'CFLAGS',
_config_vars.get('CFLAGS', ''))
- if ((macrelease + '.') >= '10.4.' and
- '-arch' in cflags.strip()):
+ if macrelease:
+ try:
+ macrelease = tuple(int(i) for i in macrelease.split('.')[0:2])
+ except ValueError:
+ macrelease = (10, 0)
+ else:
+ # assume no universal support
+ macrelease = (10, 0)
+
+ if (macrelease >= (10, 4)) and '-arch' in cflags.strip():
# The universal build will build fat binaries, but not on
# systems before 10.4
diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py
index 9853abd..e995866 100644
--- a/Lib/distutils/tests/test_build_ext.py
+++ b/Lib/distutils/tests/test_build_ext.py
@@ -444,8 +444,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.
+ if target[1] < 10:
+ # for 10.1 through 10.9.x -> "10n0"
+ target = '%02d%01d0' % target
+ else:
+ # for 10.10 and beyond -> "10nn00"
+ target = '%02d%02d00' % target
deptarget_ext = Extension(
'deptarget',
[deptarget_c],
diff --git a/Lib/test/test__osx_support.py b/Lib/test/test__osx_support.py
index fb159ec..5dcadf7 100644
--- a/Lib/test/test__osx_support.py
+++ b/Lib/test/test__osx_support.py
@@ -109,7 +109,9 @@ class Test_OSXSupport(unittest.TestCase):
def test__supports_universal_builds(self):
import platform
- 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):
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index 9a5ee91..fdf5948 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -768,7 +768,7 @@ class PosixTester(unittest.TestCase):
if sys.platform == 'darwin':
import sysconfig
dt = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') or '10.0'
- if float(dt) < 10.6:
+ if tuple(int(n) for n in dt.split('.')[0:2]) < (10, 6):
raise unittest.SkipTest("getgroups(2) is broken prior to 10.6")
# 'id -G' and 'os.getgroups()' should return the same