mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 11:14:02 +02:00
No need to manipulate sys.path when importing calibre extensions in frozen builds
This commit is contained in:
parent
29bfafa676
commit
ccdfbe96d5
1 changed files with 4 additions and 2 deletions
|
|
@ -214,7 +214,8 @@ def __init__(self):
|
|||
def load_plugin(self, name):
|
||||
if name in self._plugins:
|
||||
return
|
||||
sys.path.insert(0, plugins_loc)
|
||||
if not isfrozen:
|
||||
sys.path.insert(0, plugins_loc)
|
||||
try:
|
||||
del sys.modules[name]
|
||||
except KeyError:
|
||||
|
|
@ -229,7 +230,8 @@ def load_plugin(self, name):
|
|||
except Exception:
|
||||
plugin_err = as_unicode(native_string_type(err), encoding=preferred_encoding, errors='replace')
|
||||
self._plugins[name] = p, plugin_err
|
||||
sys.path.remove(plugins_loc)
|
||||
if not isfrozen:
|
||||
sys.path.remove(plugins_loc)
|
||||
|
||||
def __iter__(self):
|
||||
return iter(self.plugins)
|
||||
|
|
|
|||
Loading…
Reference in a new issue