mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
...
This commit is contained in:
parent
24a6174362
commit
2b38f42c7d
@ -355,7 +355,7 @@ class GuiRunner(QObject):
|
|||||||
|
|
||||||
def set_restarting_env_var():
|
def set_restarting_env_var():
|
||||||
if iswindows:
|
if iswindows:
|
||||||
ctime = plugins['winutil'][0].get_process_times(None)[0]
|
ctime = winutil.get_process_times(None)[0]
|
||||||
os.environ['CALIBRE_RESTARTING_FROM_GUI'] = str(ctime)
|
os.environ['CALIBRE_RESTARTING_FROM_GUI'] = str(ctime)
|
||||||
else:
|
else:
|
||||||
os.environ['CALIBRE_RESTARTING_FROM_GUI'] = str(os.getpid())
|
os.environ['CALIBRE_RESTARTING_FROM_GUI'] = str(os.getpid())
|
||||||
@ -525,11 +525,10 @@ def create_listener():
|
|||||||
def wait_for_parent_to_die(ppid, max_wait=10):
|
def wait_for_parent_to_die(ppid, max_wait=10):
|
||||||
ppid = int(ppid)
|
ppid = int(ppid)
|
||||||
if iswindows:
|
if iswindows:
|
||||||
get_process_times = plugins['winutil'][0].get_process_times
|
|
||||||
|
|
||||||
def parent_done():
|
def parent_done():
|
||||||
try:
|
try:
|
||||||
ctime = get_process_times(os.getppid())[0]
|
ctime = winutil.get_process_times(os.getppid())[0]
|
||||||
except Exception:
|
except Exception:
|
||||||
return True
|
return True
|
||||||
return ctime > ppid
|
return ctime > ppid
|
||||||
|
Loading…
x
Reference in New Issue
Block a user