Make sure failed loads of plugins don't prevent those plugins from later being loaded.

This commit is contained in:
Jeremy Fincher 2004-02-06 09:19:21 +00:00
parent 61e46c5049
commit 90112901f4

View File

@ -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)
module = imp.load_module(name, *moduleInfo) try:
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)