Skip to content
Snippets Groups Projects
Commit 3b941208 authored by Patrick Mezard's avatar Patrick Mezard
Browse files

win32: close file when leaving _getfileinfo()

parent 750b7a4f
No related branches found
No related tags found
No related merge requests found
......@@ -43,9 +43,10 @@
fh = win32file.CreateFile(pathname,
win32file.GENERIC_READ, win32file.FILE_SHARE_READ,
None, win32file.OPEN_EXISTING, 0, None)
res = win32file.GetFileInformationByHandle(fh)
fh.Close()
return res
try:
return win32file.GetFileInformationByHandle(fh)
finally:
fh.Close()
except pywintypes.error:
return None
......
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