Commit 8172d3dd authored by Denis Bilenko's avatar Denis Bilenko

make AsyncResult.wait return self.value

parent 1eeac226
...@@ -241,12 +241,10 @@ class AsyncResult(object): ...@@ -241,12 +241,10 @@ class AsyncResult(object):
floating point number specifying a timeout for the operation in seconds floating point number specifying a timeout for the operation in seconds
(or fractions thereof). (or fractions thereof).
This method always returns ``None`` regardless of the reason it returns. Return :attr:`value`.
To find out out what happened, use :meth:`ready` and :meth:`successful` methods
or :attr:`value` and :attr:`exception` properties.
""" """
if self._exception is not _NONE: if self._exception is not _NONE:
return return self.value
else: else:
switch = getcurrent().switch switch = getcurrent().switch
self.rawlink(switch) self.rawlink(switch)
...@@ -266,6 +264,7 @@ class AsyncResult(object): ...@@ -266,6 +264,7 @@ class AsyncResult(object):
raise raise
# not calling unlink() in non-exception case, because if switch() # not calling unlink() in non-exception case, because if switch()
# finished normally, link was already removed in _notify_links # finished normally, link was already removed in _notify_links
return self.value
def _notify_links(self): def _notify_links(self):
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment