Skip to content

Commit

Permalink
strip Generics from defer._Outcome
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Jul 13, 2021
1 parent 15abaad commit a4fe705
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/twisted/internet/defer.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,15 +346,15 @@ def __del__(self) -> None:


@attr.s(frozen=True, slots=True, auto_attribs=True)
class _Outcome(Generic[_T]):
_result: "_T | Failure"
class _Outcome:
_result: object

@_extraneous
def unwrap(self) -> _T:
def unwrap(self) -> object:
result = self._result
if isinstance(result, Failure):
result.raiseException()
return result # type: ignore[return-value]
return result


class Deferred(Awaitable[_DeferredResultT]):
Expand Down

0 comments on commit a4fe705

Please sign in to comment.