Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/a-better-future' into a-better-f…
Browse files Browse the repository at this point in the history
…uture
  • Loading branch information
justheuristic committed Jul 3, 2021
2 parents 9568979 + 1cd7fe4 commit cc113c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hivemind/utils/mpfuture.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def set_result(self, result: ResultType):
self._state_cache[self._state], self._result = base.FINISHED, result
self._send_update(UpdateType.RESULT, result)

def set_exception(self, exception: BaseException):
def set_exception(self, exception: Optional[BaseException]):
if os.getpid() == self._origin_pid:
super().set_exception(exception)
MPFuture._active_futures.pop(self._uid, None)
Expand Down Expand Up @@ -204,7 +204,7 @@ def result(self, timeout: Optional[float] = None) -> ResultType:
else:
return self._result

def exception(self, timeout: Optional[float] = None) -> BaseException:
def exception(self, timeout: Optional[float] = None) -> Optional[BaseException]:
if self._state not in TERMINAL_STATES:
if os.getpid() != self._origin_pid:
raise RuntimeError("Only the process that created MPFuture can await exception")
Expand Down

0 comments on commit cc113c9

Please sign in to comment.