Fix #2371 (error 32 while removing books from calibre-reproducible)

This commit is contained in:
Kovid Goyal 2009-04-30 18:06:25 -07:00
parent 0884de147b
commit ad62a99f13

View File

@ -760,9 +760,9 @@ class LibraryDatabase2(LibraryDatabase):
path = os.path.join(self.library_path, self.path(id, index_is_id=True))
self.data.remove(id)
if os.path.exists(path):
if iswindows:
try:
winshell.delete_file(path, no_confirm=True, silent=True)
else:
except:
self.rmtree(path)
parent = os.path.dirname(path)
if len(os.listdir(parent)) == 0: