diff --git a/src/asynkit/tools.py b/src/asynkit/tools.py index 06e8dba..f276ffb 100644 --- a/src/asynkit/tools.py +++ b/src/asynkit/tools.py @@ -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: ...