[Fix] 修正一个Bug:调用tests.Promise.set_exception后无法正常抛出异常
This commit is contained in:
parent
142a40652d
commit
af71e57732
@ -24,7 +24,7 @@ class Promise(object):
|
|||||||
res = self._queue.get(timeout=timeout)
|
res = self._queue.get(timeout=timeout)
|
||||||
if res[0] == PromiseResultType.Result:
|
if res[0] == PromiseResultType.Result:
|
||||||
return res[1]
|
return res[1]
|
||||||
raise res[2]
|
raise res[1]
|
||||||
|
|
||||||
def set_exception(self, val):
|
def set_exception(self, val):
|
||||||
self._queue.put((PromiseResultType.Exception, val))
|
self._queue.put((PromiseResultType.Exception, val))
|
||||||
|
Loading…
Reference in New Issue
Block a user