diff options
| author | Rafael H. Schloming <rhs@apache.org> | 2009-06-02 14:23:20 +0000 |
|---|---|---|
| committer | Rafael H. Schloming <rhs@apache.org> | 2009-06-02 14:23:20 +0000 |
| commit | ba07eba2031f9173855e7e6b2285a071a0d8171b (patch) | |
| tree | f6053edae43704c86f85626a91bb049887f55cab /python | |
| parent | c49fa7e3e6e94cbde06bb72ea5dcc5050299fc7c (diff) | |
| download | qpid-python-ba07eba2031f9173855e7e6b2285a071a0d8171b.tar.gz | |
made Future.get throw an exception on timeout
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@781041 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python')
| -rw-r--r-- | python/qpid/datatypes.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/python/qpid/datatypes.py b/python/qpid/datatypes.py index b2dcbe74ab..4cd3fade2c 100644 --- a/python/qpid/datatypes.py +++ b/python/qpid/datatypes.py @@ -18,6 +18,7 @@ # import threading, struct, datetime, time +from exceptions import Timeout class Struct: @@ -253,9 +254,12 @@ class Future: def get(self, timeout=None): self._set.wait(timeout) - if self._error != None: - raise self.exception(self._error) - return self.value + if self._set.isSet(): + if self._error != None: + raise self.exception(self._error) + return self.value + else: + raise Timeout() def is_set(self): return self._set.isSet() |
