##// END OF EJS Templates
checklink: always close the NamedTemporaryFile...
Augie Fackler -
r22946:77c121da default
parent child Browse files
Show More
@@ -156,9 +156,12 b' def checklink(path):'
156 156 name = tempfile.mktemp(dir=path, prefix='hg-checklink-')
157 157 try:
158 158 fd = tempfile.NamedTemporaryFile(dir=path, prefix='hg-checklink-')
159 os.symlink(os.path.basename(fd.name), name)
160 os.unlink(name)
161 return True
159 try:
160 os.symlink(os.path.basename(fd.name), name)
161 os.unlink(name)
162 return True
163 finally:
164 fd.close()
162 165 except AttributeError:
163 166 return False
164 167 except OSError, inst:
General Comments 0
You need to be logged in to leave comments. Login now