Skip to content

Commit

Permalink
Tweak Status.exception() protocol
Browse files Browse the repository at this point in the history
Make it return Optional[BaseException] like Future.exception()
  • Loading branch information
coretl committed Jun 9, 2023
1 parent e38b2da commit 2d7fdef
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions bluesky/protocols.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from abc import abstractmethod
from asyncio import CancelledError
from typing import (
Any,
Awaitable,
Expand Down Expand Up @@ -131,8 +130,6 @@ class Datum(TypedDict):
T = TypeVar("T")
SyncOrAsync = Union[T, Awaitable[T]]

StatusException = Union[Exception, CancelledError]


@runtime_checkable
class Status(Protocol):
Expand All @@ -148,7 +145,7 @@ def add_callback(self, callback: Callable[["Status"], None]) -> None:
...

@abstractmethod
def exception(self, timeout: Optional[float] = 0.0) -> Optional[StatusException]:
def exception(self, timeout: Optional[float] = 0.0) -> Optional[BaseException]:
...

@property
Expand Down

0 comments on commit 2d7fdef

Please sign in to comment.