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)