diff --git a/Lib/test/test_grp.py b/Lib/test/test_grp.py index 458ed38d3cb..f39049feac3 100755 --- a/Lib/test/test_grp.py +++ b/Lib/test/test_grp.py @@ -12,11 +12,14 @@ 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)