Skip to content

Commit

Permalink
fix Cancellable to be compatible with old python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
kristjanvalur committed Mar 10, 2024
1 parent ba9d176 commit 39c5446
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/asynkit/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,15 @@ def __lt__(self, other: PriEntry[P, T]) -> bool:


class Cancellable(Protocol):
def cancel(self, msg: Optional[str] = None) -> Union[bool, None]:
...
if sys.version_info >= (3, 9): # pragma: no cover

def cancel(self, msg: Optional[str] = None) -> Any:
...

else: # pragma: no cover

def cancel(self) -> Any:
...

def cancelled(self) -> bool:
...
Expand Down

0 comments on commit 39c5446

Please sign in to comment.