mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
commands: Explicitely close the Queue object.
This commit is contained in:
parent
bd1ac36c2c
commit
60a65b831e
@ -121,11 +121,14 @@ def process(f, *args, **kwargs):
|
|||||||
p.join(timeout)
|
p.join(timeout)
|
||||||
if p.is_alive():
|
if p.is_alive():
|
||||||
p.terminate()
|
p.terminate()
|
||||||
|
q.close()
|
||||||
raise ProcessTimeoutError("%s aborted due to timeout." % (p.name,))
|
raise ProcessTimeoutError("%s aborted due to timeout." % (p.name,))
|
||||||
try:
|
try:
|
||||||
v = q.get(block=False)
|
v = q.get(block=False)
|
||||||
except Queue.Empty:
|
except Queue.Empty:
|
||||||
return None
|
return None
|
||||||
|
finally:
|
||||||
|
q.close()
|
||||||
if isinstance(v, Exception):
|
if isinstance(v, Exception):
|
||||||
raise v
|
raise v
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user