Skip to content
Snippets Groups Projects
Commit 77c121da6143 authored by durin42's avatar durin42
Browse files

checklink: always close the NamedTemporaryFile

This fixes test-patchbomb.t when using pypy with --pure.
parent 3232f92360d4
No related branches found
No related tags found
No related merge requests found
......@@ -156,9 +156,12 @@
name = tempfile.mktemp(dir=path, prefix='hg-checklink-')
try:
fd = tempfile.NamedTemporaryFile(dir=path, prefix='hg-checklink-')
os.symlink(os.path.basename(fd.name), name)
os.unlink(name)
return True
try:
os.symlink(os.path.basename(fd.name), name)
os.unlink(name)
return True
finally:
fd.close()
except AttributeError:
return False
except OSError, inst:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment