mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix restarting not working on windows when using calibre-debug.exe -g
This commit is contained in:
parent
96d5d5a764
commit
480f1e5b48
@ -486,7 +486,9 @@ def communicate(opts, args):
|
||||
|
||||
|
||||
def restart_after_quit():
|
||||
if iswindows:
|
||||
e = sys.executable if getattr(sys, 'frozen', False) else sys.argv[0]
|
||||
is_calibre_debug_exe = os.path.splitext(e)[0].endswith('-debug')
|
||||
if iswindows and not is_calibre_debug_exe:
|
||||
# detach the stdout/stderr/stdin handles
|
||||
winutil.prepare_for_restart()
|
||||
if after_quit_actions['debug_on_restart']:
|
||||
@ -506,9 +508,8 @@ def restart_after_quit():
|
||||
else:
|
||||
cmd.append('calibre')
|
||||
else:
|
||||
e = sys.executable if getattr(sys, 'frozen', False) else sys.argv[0]
|
||||
cmd = [e]
|
||||
if os.path.splitext(e)[0].endswith('-debug'):
|
||||
if is_calibre_debug_exe:
|
||||
cmd.append('-g')
|
||||
prints('Restarting with:', ' '.join(cmd))
|
||||
subprocess.Popen(cmd)
|
||||
|
Loading…
x
Reference in New Issue
Block a user