[Fix] 修正一个Bug:调用tests.Promise.set_exception后无法正常抛出异常

This commit is contained in:
nanoric 2018-10-07 03:40:56 -04:00
parent 142a40652d
commit af71e57732

View File

@ -24,7 +24,7 @@ class Promise(object):
res = self._queue.get(timeout=timeout)
if res[0] == PromiseResultType.Result:
return res[1]
raise res[2]
raise res[1]
def set_exception(self, val):
self._queue.put((PromiseResultType.Exception, val))