summaryrefslogtreecommitdiffstats
path: root/Lib/os.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2002-06-01 14:18:47 (GMT)
committerRaymond Hettinger <python@rcn.com>2002-06-01 14:18:47 (GMT)
commit54f0222547b1e92cd018ef132307a6f793dc9505 (patch)
tree667480d89feb3f9c7ca44e4ffa7bf39e725c120d /Lib/os.py
parent9d5e4aa4149edb92f6d28c9390d776ae4a1d719a (diff)
downloadcpython-54f0222547b1e92cd018ef132307a6f793dc9505.zip
cpython-54f0222547b1e92cd018ef132307a6f793dc9505.tar.gz
cpython-54f0222547b1e92cd018ef132307a6f793dc9505.tar.bz2
SF 563203. Replaced 'has_key()' with 'in'.
Diffstat (limited to 'Lib/os.py')
-rw-r--r--Lib/os.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/os.py b/Lib/os.py
index 59f63e2..edffa47 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -333,7 +333,7 @@ def _execvpe(file, args, env=None):
if head:
apply(func, (file,) + argrest)
return
- if env.has_key('PATH'):
+ if 'PATH' in env:
envpath = env['PATH']
else:
envpath = defpath
@@ -406,7 +406,9 @@ else:
unsetenv(key)
del self.data[key.upper()]
def has_key(self, key):
- return self.data.has_key(key.upper())
+ return key.upper() in self.data
+ def __contains__(self, key):
+ return key.upper() in self.data
def get(self, key, failobj=None):
return self.data.get(key.upper(), failobj)
def update(self, dict):