mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 13:22:45 +02:00
Do not modify sys.path when using calibre-debug to run files in the calibre source code, since calibre always uses absolute imports anyway
This commit is contained in:
parent
c9b2cdfd67
commit
e2eed912b2
1 changed files with 3 additions and 2 deletions
|
|
@ -193,8 +193,9 @@ def run_script(path, args):
|
|||
|
||||
sys.argv = [path] + args
|
||||
ef = os.path.abspath(path)
|
||||
base = os.path.dirname(ef)
|
||||
sys.path.insert(0, base)
|
||||
if '/src/calibre/' not in ef.replace(os.pathsep, '/'):
|
||||
base = os.path.dirname(ef)
|
||||
sys.path.insert(0, base)
|
||||
g = globals()
|
||||
g['__name__'] = '__main__'
|
||||
g['__file__'] = ef
|
||||
|
|
|
|||
Loading…
Reference in a new issue