From: Serhiy Storchaka Date: Thu, 21 Feb 2013 12:33:45 +0000 (+0200) Subject: Issue #17248: Fix os.*chown() testing when user is in root group. X-Git-Tag: v2.7.4rc1~94 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=484dee38e665e20f961b18f27a82b3224341c1be;p=thirdparty%2FPython%2Fcpython.git Issue #17248: Fix os.*chown() testing when user is in root group. --- diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index 073e069ee8d1..b0a8cdf564d5 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -271,7 +271,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