]> granicus.if.org Git - python/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 a6d47af3193402401fde675b3af378a9a2ed3c0c..76a74fb907ba2b4ad24b3e17e03442ee54a4d0f1 100644 (file)
@@ -546,7 +546,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())