mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix command line arguments not being ignored on windows and linux when restarting calibre. Fixes #1401991 [Restarting calibre passes filenames](https://bugs.launchpad.net/calibre/+bug/1401991)
This commit is contained in:
parent
2157b1dcf4
commit
0f42e57132
@ -348,14 +348,14 @@ def run_gui(opts, args, listener, app, gui_debug=None):
|
|||||||
run_in_debug_mode()
|
run_in_debug_mode()
|
||||||
else:
|
else:
|
||||||
import subprocess
|
import subprocess
|
||||||
print 'Restarting with:', e, sys.argv
|
prints('Restarting with:', e)
|
||||||
if hasattr(sys, 'frameworks_dir'):
|
if hasattr(sys, 'frameworks_dir'):
|
||||||
app = os.path.dirname(os.path.dirname(os.path.realpath(sys.frameworks_dir)))
|
app = os.path.dirname(os.path.dirname(os.path.realpath(sys.frameworks_dir)))
|
||||||
subprocess.Popen('sleep 3s; open ' + shellquote(app), shell=True)
|
subprocess.Popen('sleep 3s; open ' + shellquote(app), shell=True)
|
||||||
else:
|
else:
|
||||||
if iswindows and hasattr(winutil, 'prepare_for_restart'):
|
if iswindows and hasattr(winutil, 'prepare_for_restart'):
|
||||||
winutil.prepare_for_restart()
|
winutil.prepare_for_restart()
|
||||||
subprocess.Popen([e] + sys.argv[1:])
|
subprocess.Popen([e])
|
||||||
else:
|
else:
|
||||||
if iswindows:
|
if iswindows:
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user