summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-06-07 10:17:15 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-06-07 10:17:15 (GMT)
commit62ec61fb6ad5f1745597017297a455d63a2f97e4 (patch)
tree5bf0a9f0d0c720191594cf5f366c6604ae05a4bf
parent5b52f957977f450613c6eafdc9216ae7993d4d49 (diff)
downloadcpython-62ec61fb6ad5f1745597017297a455d63a2f97e4.zip
cpython-62ec61fb6ad5f1745597017297a455d63a2f97e4.tar.gz
cpython-62ec61fb6ad5f1745597017297a455d63a2f97e4.tar.bz2
test.support: can_symlink() removes the temporary symbolic link
-rw-r--r--Lib/test/support.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/support.py b/Lib/test/support.py
index 2aedf24..b19c698 100644
--- a/Lib/test/support.py
+++ b/Lib/test/support.py
@@ -1487,11 +1487,14 @@ def can_symlink():
global _can_symlink
if _can_symlink is not None:
return _can_symlink
+ symlink_path = TESTFN + "can_symlink"
try:
- os.symlink(TESTFN, TESTFN + "can_symlink")
+ os.symlink(TESTFN, symlink_path)
can = True
except (OSError, NotImplementedError):
can = False
+ else:
+ os.remove(symlink_path)
_can_symlink = can
return can