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 | 11f7bdd655e5e6124add684db05273b667f67974 (patch) | |
| tree | dff9df388be99773804ce3d8e27590cb1da34b9c /qpid/python | |
| parent | 47385abda923df55d2bbd924f71c24479eb0c8e1 (diff) | |
| download | qpid-python-11f7bdd655e5e6124add684db05273b667f67974.tar.gz | |
made Future.get throw an exception on timeout
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@781041 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python')
| -rw-r--r-- | qpid/python/qpid/datatypes.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/qpid/python/qpid/datatypes.py b/qpid/python/qpid/datatypes.py index b2dcbe74ab..4cd3fade2c 100644 --- a/qpid/python/qpid/datatypes.py +++ b/qpid/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() |
