Apparently, Python 3.3 does not like sys.modules to be reassigned.

This commit is contained in:
Valentin Lorentz 2013-05-10 23:20:02 +02:00
parent 9553798c90
commit 3b179ec304

View File

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