Skip to content

Commit

Permalink
cast
Browse files Browse the repository at this point in the history
  • Loading branch information
bcherry committed Oct 28, 2024
1 parent b0f575a commit efd7784
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions livekit-rtc/livekit/rtc/participant.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from __future__ import annotations

import ctypes
from typing import List, Union, Callable, Dict, Awaitable, Optional, Mapping
from typing import List, Union, Callable, Dict, Awaitable, Optional, Mapping, cast
from abc import abstractmethod, ABC

from ._ffi_client import FfiClient, FfiHandle
Expand Down Expand Up @@ -395,7 +395,7 @@ async def _handle_rpc_method_invocation(
else:
try:
if asyncio.iscoroutinefunction(handler):
async_handler = handler # type: Callable[[RpcInvocationData], Awaitable[str]]
async_handler = cast(Callable[[RpcInvocationData], Awaitable[str]], handler)

async def run_handler():
try:
Expand All @@ -415,7 +415,7 @@ async def run_handler():
RpcError.ErrorCode.RECIPIENT_DISCONNECTED
)
else:
sync_handler = handler # type: Callable[[RpcInvocationData], str]
sync_handler = cast(Callable[[RpcInvocationData], str], handler)
response_payload = sync_handler(params)
except RpcError as error:
response_error = error
Expand Down

0 comments on commit efd7784

Please sign in to comment.