From: Victor Stinner Date: Tue, 7 Jun 2011 10:17:15 +0000 (+0200) Subject: test.support: can_symlink() removes the temporary symbolic link X-Git-Tag: v3.3.0a1~2161^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=62ec61fb6ad5f1745597017297a455d63a2f97e4;p=thirdparty%2FPython%2Fcpython.git test.support: can_symlink() removes the temporary symbolic link --- diff --git a/Lib/test/support.py b/Lib/test/support.py index 2aedf24846ee..b19c698181af 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