mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Dont sleep unnecessarily in the common case
This commit is contained in:
parent
674c3e98f8
commit
7102fcdf7c
@ -289,13 +289,13 @@ def linux_native_dialog(name):
|
||||
loop = QEventLoop(window)
|
||||
|
||||
def r():
|
||||
while not loop.isRunning():
|
||||
time.sleep(0.001) # yield so that loop starts
|
||||
try:
|
||||
ret[0] = func(window, *args, **kwargs)
|
||||
except:
|
||||
ret[1] = sys.exc_info()
|
||||
sys.exc_clear()
|
||||
while not loop.isRunning():
|
||||
time.sleep(0.001) # yield so that loop starts
|
||||
loop.quit()
|
||||
t = Thread(name='FileDialogHelper', target=r)
|
||||
t.daemon = True
|
||||
|
Loading…
x
Reference in New Issue
Block a user