Fix importing of C-extensions when people are running from source with a PYTHONPATH containing conflicting pre-imported modules

This commit is contained in:
Kovid Goyal 2014-07-03 09:16:14 +05:30
parent 327abb0ce8
commit abda001fcf

View File

@ -160,6 +160,10 @@ class Plugins(collections.Mapping):
if name in self._plugins:
return
sys.path.insert(0, sys.extensions_location)
try:
del sys.modules[name]
except KeyError:
pass
try:
p, err = importlib.import_module(name), ''
except Exception as err: