'Return the stored value or raise the exception.
If there is no value raises TimeoutError.'

def get(self, block=True, timeout=None):

    with self._condition:
        if (self._exception is not _NONE):
            if (self._exception is None):
                return self.value
            raise self._exception
        elif block:
            self._condition.wait(timeout)
            if (self._exception is not _NONE):
                if (self._exception is None):
                    return self.value
                raise self._exception
        raise TimeoutError()
