mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix temp file leak when restarting calibre from within itself
This commit is contained in:
parent
1647e17684
commit
e277a92189
@ -299,13 +299,13 @@ def run_gui(opts, args, actions, listener, app, gui_debug=None):
|
|||||||
if getattr(runner.main, 'debug_on_restart', False):
|
if getattr(runner.main, 'debug_on_restart', False):
|
||||||
run_in_debug_mode()
|
run_in_debug_mode()
|
||||||
else:
|
else:
|
||||||
|
import subprocess
|
||||||
print 'Restarting with:', e, sys.argv
|
print 'Restarting with:', e, sys.argv
|
||||||
if hasattr(sys, 'frameworks_dir'):
|
if hasattr(sys, 'frameworks_dir'):
|
||||||
app = os.path.dirname(os.path.dirname(sys.frameworks_dir))
|
app = os.path.dirname(os.path.dirname(sys.frameworks_dir))
|
||||||
import subprocess
|
|
||||||
subprocess.Popen('sleep 3s; open '+app, shell=True)
|
subprocess.Popen('sleep 3s; open '+app, shell=True)
|
||||||
else:
|
else:
|
||||||
os.execvp(e, sys.argv)
|
subprocess.Popen([e] + sys.argv[1:])
|
||||||
else:
|
else:
|
||||||
if iswindows:
|
if iswindows:
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user