]> granicus.if.org Git - python/commitdiff
test.support: can_symlink() removes the temporary symbolic link
authorVictor Stinner <victor.stinner@haypocalc.com>
Tue, 7 Jun 2011 10:17:15 +0000 (12:17 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Tue, 7 Jun 2011 10:17:15 +0000 (12:17 +0200)
Lib/test/support.py

index 2aedf24846ee4986d4dedffcba039dd9bc9cb981..b19c698181af9812bec7f7ef6527131183c6e7ff 100644 (file)
@@ -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