]> granicus.if.org Git - python/commitdiff
Issue #17248: Fix os.*chown() testing when user is in root group.
authorSerhiy Storchaka <storchaka@gmail.com>
Thu, 21 Feb 2013 12:34:36 +0000 (14:34 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Thu, 21 Feb 2013 12:34:36 +0000 (14:34 +0200)
Lib/test/test_posix.py

index 5a26d649d38f0237daccd27a1b9d9956b9289b1f..865209d7c98b48a4ca474c75ca97924e091496e5 100644 (file)
@@ -281,7 +281,7 @@ class PosixTester(unittest.TestCase):
             check_stat(uid, gid)
             self.assertRaises(OSError, chown_func, first_param, 0, -1)
             check_stat(uid, gid)
-            if gid != 0:
+            if 0 not in os.getgroups():
                 self.assertRaises(OSError, chown_func, first_param, -1, 0)
                 check_stat(uid, gid)
         # test illegal types