summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-02-20 17:47:31 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-02-20 17:47:31 (GMT)
commitfffc479f15636d4f6afb297f4f8fb0016cd162a6 (patch)
tree75fe80fcdbf9d2376315768f067e47ee2440afb1 /Lib
parent3e188c4ebbde43e320eb9873c84733f174e6700c (diff)
downloadcpython-fffc479f15636d4f6afb297f4f8fb0016cd162a6.zip
cpython-fffc479f15636d4f6afb297f4f8fb0016cd162a6.tar.gz
cpython-fffc479f15636d4f6afb297f4f8fb0016cd162a6.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 35264f7..073e069 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -269,10 +269,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)