Believe it or not, some people have an empty group database.

Prevent the test from failing there.
This commit is contained in:
Guido van Rossum 1997-12-15 14:57:19 +00:00
parent 095f35ad60
commit 30da0ea124

View file

@ -12,7 +12,10 @@ if verbose:
for group in groups: for group in groups:
print group print group
if not groups:
if verbose:
print "Empty Group Database -- no further tests of grp module possible"
else:
group = grp.getgrgid(groups[0][2]) group = grp.getgrgid(groups[0][2])
if verbose: if verbose:
print 'Group Entry for GID %d: %s' % (groups[0][2], group) print 'Group Entry for GID %d: %s' % (groups[0][2], group)