Be a little more defensive

This commit is contained in:
Kovid Goyal 2016-12-09 08:46:48 +05:30
parent 7735b0c9f7
commit 71605407dd

View File

@ -162,9 +162,10 @@ def _run_filetype_plugins(path_to_file, ft=None, occasion='preprocess'):
with plugin: with plugin:
try: try:
plugin.original_path_to_file = path_to_file plugin.original_path_to_file = path_to_file
nfp = plugin.run(path_to_file) except Exception:
if not nfp: pass
nfp = path_to_file try:
nfp = plugin.run(path_to_file) or path_to_file
except: except:
print >>oe, 'Running file type plugin %s failed with traceback:'%plugin.name print >>oe, 'Running file type plugin %s failed with traceback:'%plugin.name
traceback.print_exc(file=oe) traceback.print_exc(file=oe)