summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/sysconfig.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2006-08-18 22:13:04 (GMT)
committerGuido van Rossum <guido@python.org>2006-08-18 22:13:04 (GMT)
commite2b70bcf7401477936fba99a8bf4a1f759ecc8a3 (patch)
tree4c9b65b7fd8c26a3d2f1b64ecd6b4c72a756b4b2 /Lib/distutils/sysconfig.py
parentd2dbecb4ae9177e2e87adcb047147c6bcbf28cc1 (diff)
downloadcpython-e2b70bcf7401477936fba99a8bf4a1f759ecc8a3.zip
cpython-e2b70bcf7401477936fba99a8bf4a1f759ecc8a3.tar.gz
cpython-e2b70bcf7401477936fba99a8bf4a1f759ecc8a3.tar.bz2
Get rid of dict.has_key(). Boy this has a lot of repercussions!
Not all code has been fixed yet; this is just a checkpoint... The C API still has PyDict_HasKey() and _HasKeyString(); not sure if I want to change those just yet.
Diffstat (limited to 'Lib/distutils/sysconfig.py')
-rw-r--r--Lib/distutils/sysconfig.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index 76fe256..0ea4bb7 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -150,22 +150,22 @@ def customize_compiler(compiler):
get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
'CCSHARED', 'LDSHARED', 'SO')
- if os.environ.has_key('CC'):
+ if 'CC' in os.environ:
cc = os.environ['CC']
- if os.environ.has_key('CXX'):
+ if 'CXX' in os.environ:
cxx = os.environ['CXX']
- if os.environ.has_key('LDSHARED'):
+ if 'LDSHARED' in os.environ:
ldshared = os.environ['LDSHARED']
- if os.environ.has_key('CPP'):
+ if 'CPP' in os.environ:
cpp = os.environ['CPP']
else:
cpp = cc + " -E" # not always
- if os.environ.has_key('LDFLAGS'):
+ if 'LDFLAGS' in os.environ:
ldshared = ldshared + ' ' + os.environ['LDFLAGS']
- if os.environ.has_key('CFLAGS'):
+ if 'CFLAGS' in os.environ:
cflags = opt + ' ' + os.environ['CFLAGS']
ldshared = ldshared + ' ' + os.environ['CFLAGS']
- if os.environ.has_key('CPPFLAGS'):
+ if 'CPPFLAGS' in os.environ:
cpp = cpp + ' ' + os.environ['CPPFLAGS']
cflags = cflags + ' ' + os.environ['CPPFLAGS']
ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
@@ -277,12 +277,12 @@ def parse_makefile(fn, g=None):
if m:
n = m.group(1)
found = True
- if done.has_key(n):
+ if n in done:
item = str(done[n])
- elif notdone.has_key(n):
+ elif n in notdone:
# get it on a subsequent round
found = False
- elif os.environ.has_key(n):
+ elif n in os.environ:
# do it like make: fall back to environment
item = os.environ[n]
else:
@@ -366,7 +366,7 @@ def _init_posix():
# 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 g.has_key('MACOSX_DEPLOYMENT_TARGET'):
+ if sys.platform == 'darwin' and 'MACOSX_DEPLOYMENT_TARGET' in g:
cfg_target = g['MACOSX_DEPLOYMENT_TARGET']
cur_target = os.getenv('MACOSX_DEPLOYMENT_TARGET', '')
if cur_target == '':