##// END OF EJS Templates
win32: close file when leaving _getfileinfo()
Patrick Mezard -
r10219:3b941208 stable
parent child Browse files
Show More
@@ -43,9 +43,10 b' def _getfileinfo(pathname):'
43 fh = win32file.CreateFile(pathname,
43 fh = win32file.CreateFile(pathname,
44 win32file.GENERIC_READ, win32file.FILE_SHARE_READ,
44 win32file.GENERIC_READ, win32file.FILE_SHARE_READ,
45 None, win32file.OPEN_EXISTING, 0, None)
45 None, win32file.OPEN_EXISTING, 0, None)
46 res = win32file.GetFileInformationByHandle(fh)
46 try:
47 fh.Close()
47 return win32file.GetFileInformationByHandle(fh)
48 return res
48 finally:
49 fh.Close()
49 except pywintypes.error:
50 except pywintypes.error:
50 return None
51 return None
51
52
General Comments 0
You need to be logged in to leave comments. Login now