Skip to content

Commit 4baeeb1

Browse files
Update Lib/test/test_tempfile.py
Co-authored-by: Petr Viktorin <encukou@gmail.com>
1 parent a837624 commit 4baeeb1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎Lib/test/test_tempfile.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1901,7 +1901,8 @@ def hook(path, *, dir_fd=None):
19011901
if os.path.islink(dir1):
19021902
os.unlink(dir1)
19031903
os.rename(dir1 + '_moved', dir1)
1904-
os.chmod(dir1, 0o700)
1904+
if os.path.exists(dir1):
1905+
os.chmod(dir1, 0o700)
19051906
d1.cleanup()
19061907

19071908
self.assertTrue(os.path.exists(target_file))

0 commit comments

Comments
 (0)