mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-25 04:02:46 +01:00
Make sure failed loads of plugins don't prevent those plugins from later being loaded.
This commit is contained in:
parent
61e46c5049
commit
90112901f4
@ -81,7 +81,11 @@ def loadPluginModule(name, ignoreDeprecation=False):
|
|||||||
except ValueError: # We'd rather raise the ImportError, so we'll let go...
|
except ValueError: # We'd rather raise the ImportError, so we'll let go...
|
||||||
pass
|
pass
|
||||||
moduleInfo = imp.find_module(name, pluginDirs)
|
moduleInfo = imp.find_module(name, pluginDirs)
|
||||||
|
try:
|
||||||
module = imp.load_module(name, *moduleInfo)
|
module = imp.load_module(name, *moduleInfo)
|
||||||
|
except:
|
||||||
|
del sys.modules[name]
|
||||||
|
raise
|
||||||
if 'deprecated' in module.__dict__ and module.deprecated:
|
if 'deprecated' in module.__dict__ and module.deprecated:
|
||||||
if ignoreDeprecation:
|
if ignoreDeprecation:
|
||||||
log.warning('Deprecated plugin loaded: %s', name)
|
log.warning('Deprecated plugin loaded: %s', name)
|
||||||
|
Loading…
Reference in New Issue
Block a user