More robust way of choosing a non-existant uid (faster, too).

This commit is contained in:
Guido van Rossum 1997-05-20 19:31:25 +00:00
parent 037b2205e8
commit 6308d510e9
1 changed files with 4 additions and 4 deletions

View 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)