]> granicus.if.org Git - python/commitdiff
More robust way of choosing a non-existant uid (faster, too).
authorGuido van Rossum <guido@python.org>
Tue, 20 May 1997 19:31:25 +0000 (19:31 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 20 May 1997 19:31:25 +0000 (19:31 +0000)
Lib/test/test_pwd.py

index 1c2208d2e0345c9c0c453d0e04a919db2cbf2358..2fc8da8a593df7bdf8df2484e3a1d1907a58133a 100644 (file)
@@ -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)