sys.modules is a dict, not a list.

This commit is contained in:
Valentin Lorentz 2013-05-10 22:08:59 +02:00
parent e787f3343e
commit ee1d8731c9
1 changed files with 2 additions and 1 deletions

View File

@ -60,7 +60,8 @@ def loadPluginModule(name, ignoreDeprecation=False):
module = imp.load_module(name, *moduleInfo)
except:
sys.modules.pop(name, None)
sys.modules = filter(lambda x:not x.startswith(name + '.'), sys.modules)
sys.modules = filter(lambda x:not x[0].startswith(name + '.'),
sys.modules.items())
raise
if 'deprecated' in module.__dict__ and module.deprecated:
if ignoreDeprecation: