mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Don't leave around a test symlink file.
This commit is contained in:
parent
f434ba9e4e
commit
ee877a08e9
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue