]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
fix test_posix.test_initgroups to work without supplemental groups (closes #20249)
authorBenjamin Peterson <benjamin@python.org>
Sun, 2 Mar 2014 00:14:12 +0000 (19:14 -0500)
committerBenjamin Peterson <benjamin@python.org>
Sun, 2 Mar 2014 00:14:12 +0000 (19:14 -0500)
Lib/test/test_posix.py

index 9408e5c1b5859dc5bd584c05fa24758d3a9c1519..5c09ebfe8e44b12ee88a6b810c6b3eafa5a8b4ff 100644 (file)
@@ -1144,7 +1144,7 @@ class PosixGroupsTester(unittest.TestCase):
     def test_initgroups(self):
         # find missing group
 
-        g = max(self.saved_groups) + 1
+        g = max(self.saved_groups or [0]) + 1
         name = pwd.getpwuid(posix.getuid()).pw_name
         posix.initgroups(name, g)
         self.assertIn(g, posix.getgroups())