diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-02-20 17:49:12 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-02-20 17:49:12 (GMT) |
commit | 205e82057d90fb0a33944644798d252565655371 (patch) | |
tree | 5ef01f25fb274030c0a0cc67904eec4057fb4f6b /Lib/test/test_posix.py | |
parent | 07342983ce9301819bd4b397970e29315647e757 (diff) | |
parent | 43d9fa216766a4cf4b7753b88e57993dbf0dbf16 (diff) | |
download | cpython-205e82057d90fb0a33944644798d252565655371.zip cpython-205e82057d90fb0a33944644798d252565655371.tar.gz cpython-205e82057d90fb0a33944644798d252565655371.tar.bz2 |
Issue #17248: Fix os.*chown() testing when user has group root.
Diffstat (limited to 'Lib/test/test_posix.py')
-rw-r--r-- | Lib/test/test_posix.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index 0e326f8..840f5f6 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -451,10 +451,11 @@ class PosixTester(unittest.TestCase): # non-root cannot chown to root, raises OSError self.assertRaises(OSError, chown_func, first_param, 0, 0) check_stat(uid, gid) - self.assertRaises(OSError, chown_func, first_param, -1, 0) - check_stat(uid, gid) self.assertRaises(OSError, chown_func, first_param, 0, -1) check_stat(uid, gid) + if gid != 0: + self.assertRaises(OSError, chown_func, first_param, -1, 0) + check_stat(uid, gid) # test illegal types for t in str, float: self.assertRaises(TypeError, chown_func, first_param, t(uid), gid) |