Get a result or raise an error. If `timeout` is not None, this function 
        will wait for only `timeout` seconds before raising ThreadTimeout().

def get(self, timeout=None):
        """
        Get a result or raise an error. If `timeout` is not None, this function 
        will wait for only `timeout` seconds before raising ThreadTimeout().
        """
        if timeout is None:
            self._lock.acquire()
        else:
            self._wait(timeout)
        
        res = self.result
        if res[0]:
            return res[1]
        else:
            raise res[1]