summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pwd.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-05-20 19:31:25 (GMT)
committerGuido van Rossum <guido@python.org>1997-05-20 19:31:25 (GMT)
commit6308d510e954ad1076b579d91e42874de6a0bcde (patch)
tree82489c3ffef92f919a1ff266ca13620c99874e80 /Lib/test/test_pwd.py
parent037b2205e87e988063cd274fd20274b1848afc0e (diff)
downloadcpython-6308d510e954ad1076b579d91e42874de6a0bcde.zip
cpython-6308d510e954ad1076b579d91e42874de6a0bcde.tar.gz
cpython-6308d510e954ad1076b579d91e42874de6a0bcde.tar.bz2
More robust way of choosing a non-existant uid (faster, too).
Diffstat (limited to 'Lib/test/test_pwd.py')
-rw-r--r--Lib/test/test_pwd.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_pwd.py b/Lib/test/test_pwd.py
index 1c2208d..2fc8da8 100644
--- a/Lib/test/test_pwd.py
+++ b/Lib/test/test_pwd.py
@@ -59,10 +59,10 @@ except KeyError:
else:
print 'fakename', fakename, 'did not except pwd.getpwnam()'
-uids = byuids.keys()
-uids.sort()
-uids.reverse()
-fakeuid = uids[0] + 1
+# Choose a non-existant uid.
+fakeuid = 4127
+while byuids.has_key(fakeuid):
+ print 'fakeuid =', fakeuid
try:
pwd.getpwuid(fakeuid)