summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-02-20 17:48:47 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-02-20 17:48:47 (GMT)
commit43d9fa216766a4cf4b7753b88e57993dbf0dbf16 (patch)
tree05d9f61df18fee7b43c4e7af1218523f59e1775c /Lib
parentf0602062b6f71fd0719078ce4122e6ab2a2cd459 (diff)
parentb3d62cefc781c396754f93c98e837fb073755333 (diff)
downloadcpython-43d9fa216766a4cf4b7753b88e57993dbf0dbf16.zip
cpython-43d9fa216766a4cf4b7753b88e57993dbf0dbf16.tar.gz
cpython-43d9fa216766a4cf4b7753b88e57993dbf0dbf16.tar.bz2
Issue #17248: Fix os.*chown() testing when user has group root.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_posix.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index cfc188a..8432428 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)