mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Be a little more defensive
This commit is contained in:
parent
7735b0c9f7
commit
71605407dd
@ -162,9 +162,10 @@ def _run_filetype_plugins(path_to_file, ft=None, occasion='preprocess'):
|
||||
with plugin:
|
||||
try:
|
||||
plugin.original_path_to_file = path_to_file
|
||||
nfp = plugin.run(path_to_file)
|
||||
if not nfp:
|
||||
nfp = path_to_file
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
nfp = plugin.run(path_to_file) or path_to_file
|
||||
except:
|
||||
print >>oe, 'Running file type plugin %s failed with traceback:'%plugin.name
|
||||
traceback.print_exc(file=oe)
|
||||
|
Loading…
x
Reference in New Issue
Block a user