mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04: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
@ -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…
x
Reference in New Issue
Block a user