mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 16:03:37 +02:00
Dont sleep unnecessarily in the common case
This commit is contained in:
parent
674c3e98f8
commit
7102fcdf7c
1 changed files with 2 additions and 2 deletions
|
|
@ -289,13 +289,13 @@ def looped(window, *args, **kwargs):
|
|||
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…
Reference in a new issue