summaryrefslogtreecommitdiffstats
path: root/Lib/sysconfig.py
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2011-05-15 14:46:11 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2011-05-15 14:46:11 (GMT)
commit222e89a598664e4cffc2928da676ec22921ecc94 (patch)
tree1db33d276e14ff41224588ae4e0647f661c318df /Lib/sysconfig.py
parent2bff9fcec23798dd192932842bae9855ed47a862 (diff)
downloadcpython-222e89a598664e4cffc2928da676ec22921ecc94.zip
cpython-222e89a598664e4cffc2928da676ec22921ecc94.tar.gz
cpython-222e89a598664e4cffc2928da676ec22921ecc94.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.py20
1 files changed, 2 insertions, 18 deletions
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index 3b0ca85..41bccf3 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -345,21 +345,6 @@ def _init_posix(vars):
if hasattr(e, "strerror"):
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 (list(map(int, cfg_target.split('.'))) >
- list(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.
@@ -670,10 +655,9 @@ def get_platform():
# to. This makes the compatibility story a bit more sane because the
# 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,