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) module = imp.load_module(name, *moduleInfo)
except: except:
sys.modules.pop(name, None) sys.modules.pop(name, None)
sys.modules = dict(filter(lambda x:not x[0].startswith(name + '.'), for key in sys.modules:
sys.modules.items())) if key.startwith(name + '.'):
sys.modules.pop(key)
raise raise
if 'deprecated' in module.__dict__ and module.deprecated: if 'deprecated' in module.__dict__ and module.deprecated:
if ignoreDeprecation: if ignoreDeprecation: