summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-04-13 12:37:57 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2009-04-13 12:37:57 (GMT)
commit822e1d48bc4aacb3dc00cc0f4104232385e28207 (patch)
treea1bffa127cb0b140cb5c10196237adcc6f0eeb8f
parentf64e6514d772edcdb28c2ae9655d02a7f74ece30 (diff)
downloadcpython-822e1d48bc4aacb3dc00cc0f4104232385e28207.zip
cpython-822e1d48bc4aacb3dc00cc0f4104232385e28207.tar.gz
cpython-822e1d48bc4aacb3dc00cc0f4104232385e28207.tar.bz2
Merged revisions 71560 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r71560 | tarek.ziade | 2009-04-13 14:34:01 +0200 (Mon, 13 Apr 2009) | 1 line Fixed #5607: Distutils test_get_platform was failing fo Mac OS X fat binaries. ........
-rw-r--r--Lib/distutils/tests/test_util.py32
-rw-r--r--Misc/NEWS2
2 files changed, 33 insertions, 1 deletions
diff --git a/Lib/distutils/tests/test_util.py b/Lib/distutils/tests/test_util.py
index 6747402..f27c452 100644
--- a/Lib/distutils/tests/test_util.py
+++ b/Lib/distutils/tests/test_util.py
@@ -5,6 +5,7 @@
import os
import sys
import unittest
+from copy import copy
from distutils.errors import DistutilsPlatformError
@@ -17,6 +18,7 @@ from distutils.util import strtobool
from distutils.util import rfc822_escape
from distutils import util # used to patch _environ_checked
+from distutils.sysconfig import get_config_vars, _config_vars
class utilTestCase(unittest.TestCase):
@@ -30,6 +32,7 @@ class utilTestCase(unittest.TestCase):
self.join = os.path.join
self.isabs = os.path.isabs
self.splitdrive = os.path.splitdrive
+ self._config_vars = copy(_config_vars)
# patching os.uname
if hasattr(os, 'uname'):
@@ -42,7 +45,7 @@ class utilTestCase(unittest.TestCase):
os.uname = self._get_uname
def tearDown(self):
- # getting back tne environment
+ # getting back the environment
os.name = self.name
sys.platform = self.platform
sys.version = self.version
@@ -55,6 +58,7 @@ class utilTestCase(unittest.TestCase):
os.uname = self.uname
else:
del os.uname
+ _config_vars = copy(self._config_vars)
def _set_uname(self, uname):
self._uname = uname
@@ -96,8 +100,34 @@ class utilTestCase(unittest.TestCase):
'root:xnu-792.25.20~1/RELEASE_I386'), 'i386'))
os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.3'
+ get_config_vars()['CFLAGS'] = ('-fno-strict-aliasing -DNDEBUG -g '
+ '-fwrapv -O3 -Wall -Wstrict-prototypes')
+
self.assertEquals(get_platform(), 'macosx-10.3-i386')
+ # macbook with fat binaries (fat, universal or fat64)
+ os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.4'
+ get_config_vars()['CFLAGS'] = ('-arch ppc -arch i386 -isysroot '
+ '/Developer/SDKs/MacOSX10.4u.sdk '
+ '-fno-strict-aliasing -fno-common '
+ '-dynamic -DNDEBUG -g -O3')
+
+ self.assertEquals(get_platform(), 'macosx-10.4-fat')
+
+ get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch i386 -isysroot '
+ '/Developer/SDKs/MacOSX10.4u.sdk '
+ '-fno-strict-aliasing -fno-common '
+ '-dynamic -DNDEBUG -g -O3')
+
+ self.assertEquals(get_platform(), 'macosx-10.4-universal')
+
+ get_config_vars()['CFLAGS'] = ('-arch x86_64 -isysroot '
+ '/Developer/SDKs/MacOSX10.4u.sdk '
+ '-fno-strict-aliasing -fno-common '
+ '-dynamic -DNDEBUG -g -O3')
+
+ self.assertEquals(get_platform(), 'macosx-10.4-fat64')
+
# linux debian sarge
os.name = 'posix'
sys.version = ('2.3.5 (#1, Jul 4 2007, 17:28:59) '
diff --git a/Misc/NEWS b/Misc/NEWS
index b89516c..b5b4928 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -348,6 +348,8 @@ Core and Builtins
Library
-------
+- Issue #5607: fixed Distutils test_get_platform for Mac OS X fat binaries.
+
- Issue #5732: added a new command in Distutils: check.
- Issue #5731: Distutils bdist_wininst no longer worked on non-Windows