From 3afe76ab301f6d62eab8b440d8c5e3f67129c15d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 15 Dec 2014 07:37:31 +0530 Subject: [PATCH] Fix change that broke restarting with calibre-debug -g --- src/calibre/gui2/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/main.py b/src/calibre/gui2/main.py index 0077807e67..ded9b13459 100644 --- a/src/calibre/gui2/main.py +++ b/src/calibre/gui2/main.py @@ -348,14 +348,16 @@ def run_gui(opts, args, listener, app, gui_debug=None): run_in_debug_mode() else: import subprocess - prints('Restarting with:', e) if hasattr(sys, 'frameworks_dir'): app = os.path.dirname(os.path.dirname(os.path.realpath(sys.frameworks_dir))) + prints('Restarting with:', app) subprocess.Popen('sleep 3s; open ' + shellquote(app), shell=True) else: if iswindows and hasattr(winutil, 'prepare_for_restart'): winutil.prepare_for_restart() - subprocess.Popen([e]) + args = ['-g'] if os.path.splitext(e)[0].endswith('-debug') else [] + prints('Restarting with:', ' '.join([e] + args)) + subprocess.Popen([e] + args) else: if iswindows: try: