Skip to content

Commit 69c2702

Browse files
committed
fix: backport to Python3.8
1 parent 519ce26 commit 69c2702

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/graia/amnesia/transport/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ def __init_subclass__(cls, **kwargs) -> None:
2929
cls.declares.extend(base.declares)
3030

3131
def get_handler(self, signature: TransportSignature[Callable[P, T]]) -> Callable[P, T]:
32-
handler = cast(Callable[Concatenate[Transport, P], T] | None, self.handlers.get(signature))
32+
handler = cast("Callable[Concatenate[Transport, P], T] | None", self.handlers.get(signature))
3333
if handler is None:
3434
raise TypeError(f"{self.__class__.__name__} has no handler for {signature}")
3535
return partial(handler, self) # type: ignore
3636

3737
def get_callbacks(self, signature: TransportSignature[Callable[P, T]]) -> list[Callable[P, T]]:
38-
callbacks = cast(list[Callable[Concatenate[Self, P], T]] | None, self.callbacks.get(signature))
38+
callbacks = cast("list[Callable[Concatenate[Self, P], T]] | None", self.callbacks.get(signature))
3939
if not callbacks:
4040
raise TypeError(f"{self.__class__.__name__} has no callback for {signature}")
4141
return [partial(callback, self) for callback in callbacks] # type: ignore

0 commit comments

Comments
 (0)