mirror of
https://github.com/fergalmoran/picard.git
synced 2026-02-25 09:03:59 +00:00
PICARD-1221: Handle exception on loading incompatible plugins
Picard crashes with an 'Unable to execute tagger script' message due to py2 syntax. This fixes the crash by catching the exception and logging an error message saying that Picard is unable to load a specific plugin.
This commit is contained in:
@@ -281,7 +281,10 @@ class PluginManager(QtCore.QObject):
|
||||
plugindir,
|
||||
len(names))
|
||||
for name in sorted(names):
|
||||
self.load_plugin(name, plugindir)
|
||||
try:
|
||||
self.load_plugin(name, plugindir)
|
||||
except Exception as e:
|
||||
log.error('Unable to load plugin: %s.\nError occured: %s', name, e)
|
||||
|
||||
def load_plugin(self, name, plugindir):
|
||||
module_file = None
|
||||
@@ -432,7 +435,12 @@ class PluginManager(QtCore.QObject):
|
||||
shutil.rmtree(dst)
|
||||
shutil.copytree(path, dst)
|
||||
if action != PLUGIN_ACTION_UPDATE:
|
||||
installed_plugin = self.load_plugin(zip_plugin or plugin_name, USER_PLUGIN_DIR)
|
||||
try:
|
||||
installed_plugin = self.load_plugin(zip_plugin or plugin_name, USER_PLUGIN_DIR)
|
||||
except Exception as e:
|
||||
log.error('Unable to load plugin: %s.\nError occured: %s', name, e)
|
||||
installed_plugin = None
|
||||
|
||||
if installed_plugin is not None:
|
||||
self.plugin_installed.emit(installed_plugin, False)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user