Skip to content

Commit efd7784

Browse files
committed
cast
1 parent b0f575a commit efd7784

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

livekit-rtc/livekit/rtc/participant.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from __future__ import annotations
1616

1717
import ctypes
18-
from typing import List, Union, Callable, Dict, Awaitable, Optional, Mapping
18+
from typing import List, Union, Callable, Dict, Awaitable, Optional, Mapping, cast
1919
from abc import abstractmethod, ABC
2020

2121
from ._ffi_client import FfiClient, FfiHandle
@@ -395,7 +395,7 @@ async def _handle_rpc_method_invocation(
395395
else:
396396
try:
397397
if asyncio.iscoroutinefunction(handler):
398-
async_handler = handler # type: Callable[[RpcInvocationData], Awaitable[str]]
398+
async_handler = cast(Callable[[RpcInvocationData], Awaitable[str]], handler)
399399

400400
async def run_handler():
401401
try:
@@ -415,7 +415,7 @@ async def run_handler():
415415
RpcError.ErrorCode.RECIPIENT_DISCONNECTED
416416
)
417417
else:
418-
sync_handler = handler # type: Callable[[RpcInvocationData], str]
418+
sync_handler = cast(Callable[[RpcInvocationData], str], handler)
419419
response_payload = sync_handler(params)
420420
except RpcError as error:
421421
response_error = error

0 commit comments

Comments
 (0)