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

Skip to content

Commit fc9bf11

Browse files
Issue #17248: Fix os.*chown() testing when user is in root group.
2 parents 542b7d1 + 9d202ba commit fc9bf11

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
@@ -453,7 +453,7 @@ def check_stat(uid, gid):
453453
check_stat(uid, gid)
454454
self.assertRaises(OSError, chown_func, first_param, 0, -1)
455455
check_stat(uid, gid)
456-
if gid != 0:
456+
if 0 not in os.getgroups():
457457
self.assertRaises(OSError, chown_func, first_param, -1, 0)
458458
check_stat(uid, gid)
459459
# test illegal types

0 commit comments

Comments
 (0)