Fix exception not being re-raised when deleting book fails

This commit is contained in:
Kovid Goyal 2017-06-21 09:23:54 +05:30
parent acaee61715
commit d8967eae75
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -5,7 +5,7 @@ __license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import errno
import errno, os
from functools import partial
from collections import Counter
@ -379,12 +379,12 @@ class DeleteAction(InterfaceAction):
except IOError as err:
if err.errno == errno.EACCES:
import traceback
fname = getattr(err, 'filename', 'file') or 'file'
fname = os.path.basename(getattr(err, 'filename', 'file') or 'file')
return error_dialog(self.gui, _('Permission denied'),
_('Could not access %s. Is it being used by another'
' program? Click "Show details" for more information.')%fname, det_msg=traceback.format_exc(),
show=True)
raise
self.library_ids_deleted2(to_delete_ids, next_id=next_id)
else:
self.__md = MultiDeleter(self.gui, to_delete_ids,