summaryrefslogtreecommitdiff
path: root/Lib/ntpath.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2002-06-01 14:18:47 +0000
committerRaymond Hettinger <python@rcn.com>2002-06-01 14:18:47 +0000
commit73a2a7244e024f1876ae5ba69109b82fa30b2d22 (patch)
tree9433e3e2c56fa3f4c3cb24caa2dd8563345d3c52 /Lib/ntpath.py
parent57f39f3bd34a7547ed8305cfb6cd1941b7530d7f (diff)
downloadcpython-73a2a7244e024f1876ae5ba69109b82fa30b2d22.tar.gz
SF 563203. Replaced 'has_key()' with 'in'.
Diffstat (limited to 'Lib/ntpath.py')
-rw-r--r--Lib/ntpath.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/ntpath.py b/Lib/ntpath.py
index 370bd6e061..7b758d0972 100644
--- a/Lib/ntpath.py
+++ b/Lib/ntpath.py
@@ -343,9 +343,9 @@ def expanduser(path):
while i < n and path[i] not in '/\\':
i = i + 1
if i == 1:
- if os.environ.has_key('HOME'):
+ if 'HOME' in os.environ:
userhome = os.environ['HOME']
- elif not os.environ.has_key('HOMEPATH'):
+ elif not 'HOMEPATH' in os.environ:
return path
else:
try:
@@ -399,7 +399,7 @@ def expandvars(path):
try:
index = path.index('}')
var = path[:index]
- if os.environ.has_key(var):
+ if var in os.environ:
res = res + os.environ[var]
except ValueError:
res = res + path
@@ -412,7 +412,7 @@ def expandvars(path):
var = var + c
index = index + 1
c = path[index:index + 1]
- if os.environ.has_key(var):
+ if var in os.environ:
res = res + os.environ[var]
if c != '':
res = res + c