mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-22 19:53:31 +02:00
Fix importing of C-extensions when people are running from source with a PYTHONPATH containing conflicting pre-imported modules
This commit is contained in:
parent
327abb0ce8
commit
abda001fcf
1 changed files with 4 additions and 0 deletions
|
|
@ -160,6 +160,10 @@ def load_plugin(self, name):
|
|||
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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue