This commit is contained in:
Kovid Goyal 2020-10-16 18:24:28 +05:30
parent 24a6174362
commit 2b38f42c7d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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