]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Don't leave around a test symlink file.
authorBrett Cannon <brett@python.org>
Tue, 15 Mar 2011 21:32:14 +0000 (17:32 -0400)
committerBrett Cannon <brett@python.org>
Tue, 15 Mar 2011 21:32:14 +0000 (17:32 -0400)
Lib/test/support.py

index 98f333e28970c7b2da68be9905174b0f07823b1c..66d7f934370fdf1ecd436f3902f676c528169346 100644 (file)
@@ -1465,9 +1465,11 @@ 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
+        os.remove(symlink_path)
     except (OSError, NotImplementedError):
         can = False
     _can_symlink = can