mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Believe it or not, some people have an empty group database.
Prevent the test from failing there.
This commit is contained in:
parent
095f35ad60
commit
30da0ea124
1 changed files with 10 additions and 7 deletions
|
@ -12,11 +12,14 @@ if verbose:
|
|||
for group in groups:
|
||||
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])
|
||||
if verbose:
|
||||
print 'Group Entry for GID %d: %s' % (groups[0][2], group)
|
||||
|
||||
group = grp.getgrgid(groups[0][2])
|
||||
if verbose:
|
||||
print 'Group Entry for GID %d: %s' % (groups[0][2], group)
|
||||
|
||||
group = grp.getgrnam(groups[0][0])
|
||||
if verbose:
|
||||
print 'Group Entry for group %s: %s' % (groups[0][0], group)
|
||||
group = grp.getgrnam(groups[0][0])
|
||||
if verbose:
|
||||
print 'Group Entry for group %s: %s' % (groups[0][0], group)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue