Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a2964b3

Browse files
Issue #17248: Fix os.*chown() testing when user is in root group.
1 parent bcbc567 commit a2964b3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/test/test_posix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def check_stat(uid, gid):
281281
check_stat(uid, gid)
282282
self.assertRaises(OSError, chown_func, first_param, 0, -1)
283283
check_stat(uid, gid)
284-
if gid != 0:
284+
if 0 not in os.getgroups():
285285
self.assertRaises(OSError, chown_func, first_param, -1, 0)
286286
check_stat(uid, gid)
287287
# test illegal types

0 commit comments

Comments
 (0)