summaryrefslogtreecommitdiffstats
path: root/Lib/sysconfig.py
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2011-05-15 14:44:27 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2011-05-15 14:44:27 (GMT)
commita70286b71d6b98c14275c26f6ca1f0507c1bc56b (patch)
treeb6b408265b1f73561e2ff80fa03fd817b0a8e65a /Lib/sysconfig.py
parent11041f0af94aec94500a5fd65f709d9de00bc943 (diff)
downloadcpython-a70286b71d6b98c14275c26f6ca1f0507c1bc56b.zip
cpython-a70286b71d6b98c14275c26f6ca1f0507c1bc56b.tar.gz
cpython-a70286b71d6b98c14275c26f6ca1f0507c1bc56b.tar.bz2
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.
Diffstat (limited to 'Lib/sysconfig.py')
-rw-r--r--Lib/sysconfig.py19
1 files changed, 1 insertions, 18 deletions
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index 3146f30..9e8acc5 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -297,21 +297,6 @@ def _init_posix(vars):
msg = msg + " (%s)" % e.strerror
raise IOError(msg)
- # On MacOSX we need to check the setting of the environment variable
- # MACOSX_DEPLOYMENT_TARGET: configure bases some choices on it so
- # it needs to be compatible.
- # If it isn't set we set it to the configure-time value
- if sys.platform == 'darwin' and 'MACOSX_DEPLOYMENT_TARGET' in vars:
- cfg_target = vars['MACOSX_DEPLOYMENT_TARGET']
- cur_target = os.getenv('MACOSX_DEPLOYMENT_TARGET', '')
- if cur_target == '':
- cur_target = cfg_target
- os.putenv('MACOSX_DEPLOYMENT_TARGET', cfg_target)
- elif map(int, cfg_target.split('.')) > map(int, cur_target.split('.')):
- msg = ('$MACOSX_DEPLOYMENT_TARGET mismatch: now "%s" but "%s" '
- 'during configure' % (cur_target, cfg_target))
- raise IOError(msg)
-
# On AIX, there are wrong paths to the linker scripts in the Makefile
# -- these paths are relative to the Python source, but when installed
# the scripts are in another directory.
@@ -616,9 +601,7 @@ def get_platform():
# machine is going to compile and link as if it were
# MACOSX_DEPLOYMENT_TARGET.
cfgvars = get_config_vars()
- macver = os.environ.get('MACOSX_DEPLOYMENT_TARGET')
- if not macver:
- macver = cfgvars.get('MACOSX_DEPLOYMENT_TARGET')
+ macver = cfgvars.get('MACOSX_DEPLOYMENT_TARGET')
if 1:
# Always calculate the release of the running machine,