summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_os.py
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2012-06-23 23:55:07 (GMT)
committerLarry Hastings <larry@hastings.org>2012-06-23 23:55:07 (GMT)
commitb698d8e7e91061fd247743b31b7228dc64eceba8 (patch)
tree5f872cf5f5303bfa282a3dce641f1df6b579378c /Lib/test/test_os.py
parentb7eb563a2a69ba7182b8dc0634b53dc37b7d93a1 (diff)
downloadcpython-b698d8e7e91061fd247743b31b7228dc64eceba8.zip
cpython-b698d8e7e91061fd247743b31b7228dc64eceba8.tar.gz
cpython-b698d8e7e91061fd247743b31b7228dc64eceba8.tar.bz2
Issue #15154: Add "dir_fd" parameter to os.rmdir, remove "rmdir"
parameter from os.remove / os.unlink. Patch written by Georg Brandl. (I'm really looking forward to George getting commit privileges so I don't have to keep doing checkins on his behalf.)
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r--Lib/test/test_os.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index cc1120f..654dd23 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -785,7 +785,10 @@ class FwalkTests(WalkTests):
os.unlink(name, dir_fd=rootfd)
for name in dirs:
st = os.stat(name, dir_fd=rootfd, follow_symlinks=False)
- os.unlink(name, dir_fd=rootfd, rmdir=stat.S_ISDIR(st.st_mode))
+ if stat.S_ISDIR(st.st_mode):
+ os.rmdir(name, dir_fd=rootfd)
+ else:
+ os.unlink(name, dir_fd=rootfd)
os.rmdir(support.TESTFN)