From 90112901f4e031ba2a709f361303a8aef80fdda0 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Fri, 6 Feb 2004 09:19:21 +0000 Subject: [PATCH] Make sure failed loads of plugins don't prevent those plugins from later being loaded. --- src/Owner.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Owner.py b/src/Owner.py index 58b7f7657..6d0e19e2b 100644 --- a/src/Owner.py +++ b/src/Owner.py @@ -81,7 +81,11 @@ def loadPluginModule(name, ignoreDeprecation=False): except ValueError: # We'd rather raise the ImportError, so we'll let go... pass 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 ignoreDeprecation: log.warning('Deprecated plugin loaded: %s', name)