mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Issue #9516: avoid errors in sysconfig when MACOSX_DEPLOYMENT_TARGET is set in shell.
Without this patch python will fail to start properly when the environment variable MACOSX_DEPLOYMENT_TARGET is set on MacOSX and has a value that is not compatible with the value during Python's build. This is caused by code in sysconfig that was only meant to be used in disutils.
This commit is contained in:
parent
2bff9fcec2
commit
222e89a598
6 changed files with 126 additions and 27 deletions
|
@ -92,7 +92,7 @@ class UtilTestCase(support.EnvironGuard, unittest.TestCase):
|
|||
('Darwin Kernel Version 8.11.1: '
|
||||
'Wed Oct 10 18:23:28 PDT 2007; '
|
||||
'root:xnu-792.25.20~1/RELEASE_I386'), 'i386'))
|
||||
os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.3'
|
||||
get_config_vars()['MACOSX_DEPLOYMENT_TARGET'] = '10.3'
|
||||
|
||||
get_config_vars()['CFLAGS'] = ('-fno-strict-aliasing -DNDEBUG -g '
|
||||
'-fwrapv -O3 -Wall -Wstrict-prototypes')
|
||||
|
@ -105,7 +105,7 @@ class UtilTestCase(support.EnvironGuard, unittest.TestCase):
|
|||
sys.maxsize = cursize
|
||||
|
||||
# macbook with fat binaries (fat, universal or fat64)
|
||||
os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.4'
|
||||
get_config_vars()['MACOSX_DEPLOYMENT_TARGET'] = '10.4'
|
||||
get_config_vars()['CFLAGS'] = ('-arch ppc -arch i386 -isysroot '
|
||||
'/Developer/SDKs/MacOSX10.4u.sdk '
|
||||
'-fno-strict-aliasing -fno-common '
|
||||
|
@ -113,6 +113,10 @@ class UtilTestCase(support.EnvironGuard, unittest.TestCase):
|
|||
|
||||
self.assertEqual(get_platform(), 'macosx-10.4-fat')
|
||||
|
||||
os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.1'
|
||||
self.assertEqual(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 '
|
||||
|
@ -147,6 +151,7 @@ class UtilTestCase(support.EnvironGuard, unittest.TestCase):
|
|||
|
||||
self.assertEqual(get_platform(), 'macosx-10.4-%s'%(arch,))
|
||||
|
||||
|
||||
# linux debian sarge
|
||||
os.name = 'posix'
|
||||
sys.version = ('2.3.5 (#1, Jul 4 2007, 17:28:59) '
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue