def _get_result(self): while self._state == self.STATE_PENDING: self.conn.serve() if self._state == self.STATE_READY: return self._result elif self._state == self.STATE_EXCEPTION: raise_exception(*self._result)
def dispatch_exception(self, seq, obj): excobj = load_exception(obj) if seq in self.async_replies: self.async_replies.pop(seq)(excobj, True) else: raise_exception(*excobj)