move _raise_deadline() out of except block to clean up printed stacktrace
This commit is contained in:
parent
ea1698499f
commit
dce6eee8c9
1 changed files with 4 additions and 0 deletions
|
@ -398,10 +398,14 @@ def deadline_process(func: typing.Callable[[], None], seconds: int=10):
|
|||
p = multiprocessing.Process(target=_wrap, args=(func, q))
|
||||
p.start()
|
||||
|
||||
deadlined = False
|
||||
try:
|
||||
success, out = q.get(block=True, timeout=seconds)
|
||||
except queue.Empty:
|
||||
p.kill()
|
||||
deadlined = True
|
||||
|
||||
if deadlined:
|
||||
_raise_deadline()
|
||||
|
||||
if success:
|
||||
|
|
Loading…
Reference in a new issue