diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-04-01 23:13:18 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-04-01 23:13:18 (GMT) |
commit | ee5f1c13d1ea21c628068fdf142823177f5526c2 (patch) | |
tree | 971c190264009a1f615d856594d46554b5494bfd /Lib/test/test_os.py | |
parent | b4be376d16cba52c91afc5a9dc8ff36ae96e26d9 (diff) | |
download | cpython-ee5f1c13d1ea21c628068fdf142823177f5526c2.zip cpython-ee5f1c13d1ea21c628068fdf142823177f5526c2.tar.gz cpython-ee5f1c13d1ea21c628068fdf142823177f5526c2.tar.bz2 |
remove directory mode check from makedirs (closes #21082)
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r-- | Lib/test/test_os.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 720e78b..a08edd6 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -579,7 +579,7 @@ class MakedirTests(unittest.TestCase): os.makedirs(path, mode) self.assertRaises(OSError, os.makedirs, path, mode) self.assertRaises(OSError, os.makedirs, path, mode, exist_ok=False) - self.assertRaises(OSError, os.makedirs, path, 0o776, exist_ok=True) + os.makedirs(path, 0o776, exist_ok=True) os.makedirs(path, mode=mode, exist_ok=True) finally: os.umask(old_mask) @@ -606,9 +606,8 @@ class MakedirTests(unittest.TestCase): os.makedirs(path, mode, exist_ok=True) # remove the bit. os.chmod(path, stat.S_IMODE(os.lstat(path).st_mode) & ~S_ISGID) - with self.assertRaises(OSError): - # Should fail when the bit is not already set when demanded. - os.makedirs(path, mode | S_ISGID, exist_ok=True) + # May work even when the bit is not already set when demanded. + os.makedirs(path, mode | S_ISGID, exist_ok=True) finally: os.umask(old_mask) |