summaryrefslogtreecommitdiffstats
path: root/Lib/plat-os2emx
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-09-01 20:35:04 (GMT)
committerCollin Winter <collinw@gmail.com>2007-09-01 20:35:04 (GMT)
commit0470689215bb10e6dc3be169bc2fac6e15b659fc (patch)
treee4f2559ce2807b85d3ff3f61df2dc95e55f6f268 /Lib/plat-os2emx
parentba21f618a301a36b13a25c2d51e74562363c6d67 (diff)
downloadcpython-0470689215bb10e6dc3be169bc2fac6e15b659fc.zip
cpython-0470689215bb10e6dc3be169bc2fac6e15b659fc.tar.gz
cpython-0470689215bb10e6dc3be169bc2fac6e15b659fc.tar.bz2
Run 2to3's fix_has_key over Lib/plat-os2emx/.
Diffstat (limited to 'Lib/plat-os2emx')
-rw-r--r--Lib/plat-os2emx/grp.py10
-rw-r--r--Lib/plat-os2emx/pwd.py12
2 files changed, 11 insertions, 11 deletions
diff --git a/Lib/plat-os2emx/grp.py b/Lib/plat-os2emx/grp.py
index 2ac3ca6..8ac9b15 100644
--- a/Lib/plat-os2emx/grp.py
+++ b/Lib/plat-os2emx/grp.py
@@ -58,11 +58,11 @@ import os
# try and find the group file
__group_path = []
-if os.environ.has_key('ETC_GROUP'):
+if 'ETC_GROUP' in os.environ:
__group_path.append(os.environ['ETC_GROUP'])
-if os.environ.has_key('ETC'):
+if 'ETC' in os.environ:
__group_path.append('%s/group' % os.environ['ETC'])
-if os.environ.has_key('PYTHONHOME'):
+if 'PYTHONHOME' in os.environ:
__group_path.append('%s/Etc/group' % os.environ['PYTHONHOME'])
group_file = None
@@ -149,9 +149,9 @@ def __read_group_file():
fields[2] = int(fields[2])
fields[3] = [f.strip() for f in fields[3].split(',')]
record = Group(*fields)
- if not gidx.has_key(fields[2]):
+ if fields[2] not in gidx:
gidx[fields[2]] = record
- if not namx.has_key(fields[0]):
+ if fields[0] not in namx:
namx[fields[0]] = record
elif len(entry) > 0:
pass # skip empty or malformed records
diff --git a/Lib/plat-os2emx/pwd.py b/Lib/plat-os2emx/pwd.py
index 4924c90..e1739bd 100644
--- a/Lib/plat-os2emx/pwd.py
+++ b/Lib/plat-os2emx/pwd.py
@@ -61,11 +61,11 @@ import os
# try and find the passwd file
__passwd_path = []
-if os.environ.has_key('ETC_PASSWD'):
+if 'ETC_PASSWD' in os.environ:
__passwd_path.append(os.environ['ETC_PASSWD'])
-if os.environ.has_key('ETC'):
+if 'ETC' in os.environ:
__passwd_path.append('%s/passwd' % os.environ['ETC'])
-if os.environ.has_key('PYTHONHOME'):
+if 'PYTHONHOME' in os.environ:
__passwd_path.append('%s/Etc/passwd' % os.environ['PYTHONHOME'])
passwd_file = None
@@ -164,7 +164,7 @@ def __read_passwd_file():
uidx = {}
namx = {}
sep = None
- while 1:
+ while True:
entry = passwd.readline().strip()
if len(entry) > 6:
if sep == None:
@@ -175,9 +175,9 @@ def __read_passwd_file():
for i in (5, 6):
fields[i] = __field_sep[sep](fields[i])
record = Passwd(*fields)
- if not uidx.has_key(fields[2]):
+ if fields[2] not in uidx:
uidx[fields[2]] = record
- if not namx.has_key(fields[0]):
+ if fields[0] not in namx:
namx[fields[0]] = record
elif len(entry) > 0:
pass # skip empty or malformed records