Fix #2598 (Calibre 0.6b6 Crash While Converting)

This commit is contained in:
Kovid Goyal 2009-06-17 15:42:14 -07:00
parent cab5e4f95c
commit 78cd647c6e

View File

@ -15,7 +15,7 @@ class LockError(Exception):
class ExclusiveFile(object): class ExclusiveFile(object):
def __init__(self, path, timeout=10): def __init__(self, path, timeout=15):
self.path = path self.path = path
self.timeout = timeout self.timeout = timeout
@ -44,10 +44,9 @@ class ExclusiveFile(object):
return self.file return self.file
def __exit__(self, type, value, traceback): def __exit__(self, type, value, traceback):
self.file.close()
if iswindows: if iswindows:
win32api.CloseHandle(self.mutex) win32api.CloseHandle(self.mutex)
self.file.close()
def _clean_lock_file(file): def _clean_lock_file(file):
try: try: