mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 20:52:42 +01:00
only raise in commands.process() when a raise was wrapped (#1370)
This commit is contained in:
parent
219ac6d154
commit
6c5072cfe0
@ -123,9 +123,9 @@ def process(f, *args, **kwargs):
|
||||
resource.setrlimit(rsrc, (soft, hard))
|
||||
try:
|
||||
r = f(*args, **kwargs)
|
||||
q.put(r)
|
||||
q.put([False, r])
|
||||
except Exception as e:
|
||||
q.put(e)
|
||||
q.put([True, e])
|
||||
targetArgs = (f, q,) + args
|
||||
p = callbacks.CommandProcess(target=newf,
|
||||
args=targetArgs, kwargs=kwargs)
|
||||
@ -136,12 +136,13 @@ def process(f, *args, **kwargs):
|
||||
q.close()
|
||||
raise ProcessTimeoutError("%s aborted due to timeout." % (p.name,))
|
||||
try:
|
||||
v = q.get(block=False)
|
||||
raised, v = q.get(block=False)
|
||||
except minisix.queue.Empty:
|
||||
return None
|
||||
finally:
|
||||
q.close()
|
||||
if isinstance(v, Exception):
|
||||
|
||||
if raised:
|
||||
raise v
|
||||
else:
|
||||
return v
|
||||
|
Loading…
Reference in New Issue
Block a user