Skip to content

Commit 26c802c

Browse files
committed
fix return type errors
1 parent d92a7f3 commit 26c802c

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

livekit-rtc/livekit/rtc/audio_frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def __repr__(self) -> str:
186186
)
187187

188188
@classmethod
189-
def __get_pydantic_core_schema__(cls, *_: Any):
189+
def __get_pydantic_core_schema__(cls, *_: Any) -> Any:
190190
from pydantic_core import core_schema
191191
import base64
192192

livekit-rtc/livekit/rtc/event_emitter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import inspect
22
import asyncio
3-
from typing import Callable, Dict, Set, Optional, Generic, TypeVar
3+
from typing import Any, Callable, Dict, Set, Optional, Generic, TypeVar
44

55
from .log import logger
66

@@ -14,7 +14,7 @@ def __init__(self) -> None:
1414
"""
1515
self._events: Dict[T_contra, Set[Callable]] = dict()
1616

17-
def emit(self, event: T_contra, *args) -> None:
17+
def emit(self, event: T_contra, *args: Any) -> None:
1818
"""
1919
Trigger all callbacks associated with the given event.
2020
@@ -104,7 +104,7 @@ def greet_once(name):
104104
"""
105105
if callback is not None:
106106

107-
def once_callback(*args, **kwargs):
107+
def once_callback(*args: Any, **kwargs: Any) -> None:
108108
self.off(event, once_callback)
109109
callback(*args, **kwargs)
110110

livekit-rtc/livekit/rtc/synchronizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import logging
33
import time
44
from collections import deque
5-
from typing import Optional, Union
5+
from typing import Any, Optional, Union
66

77
from .video_frame import VideoFrame
88
from .audio_frame import AudioFrame
@@ -149,7 +149,7 @@ def __init__(self, *, expected_fps: float, max_delay_tolerance_ms: float = 300)
149149
async def __aenter__(self) -> None:
150150
await self.wait_next_process()
151151

152-
async def __aexit__(self, exc_type, exc_val, exc_tb) -> None:
152+
async def __aexit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None:
153153
self.after_process()
154154

155155
def reset(self) -> None:

livekit-rtc/livekit/rtc/track.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ def create_audio_track(name: str, source: "AudioSource") -> "LocalAudioTrack":
8080
resp = FfiClient.instance.request(req)
8181
return LocalAudioTrack(resp.create_audio_track.track)
8282

83-
def mute(self):
83+
def mute(self) -> None:
8484
req = proto_ffi.FfiRequest()
8585
req.local_track_mute.track_handle = self._ffi_handle.handle
8686
req.local_track_mute.mute = True
8787
FfiClient.instance.request(req)
8888
self._info.muted = True
8989

90-
def unmute(self):
90+
def unmute(self) -> None:
9191
req = proto_ffi.FfiRequest()
9292
req.local_track_mute.track_handle = self._ffi_handle.handle
9393
req.local_track_mute.mute = False
@@ -111,14 +111,14 @@ def create_video_track(name: str, source: "VideoSource") -> "LocalVideoTrack":
111111
resp = FfiClient.instance.request(req)
112112
return LocalVideoTrack(resp.create_video_track.track)
113113

114-
def mute(self):
114+
def mute(self) -> None:
115115
req = proto_ffi.FfiRequest()
116116
req.local_track_mute.track_handle = self._ffi_handle.handle
117117
req.local_track_mute.mute = True
118118
FfiClient.instance.request(req)
119119
self._info.muted = True
120120

121-
def unmute(self):
121+
def unmute(self) -> None:
122122
req = proto_ffi.FfiRequest()
123123
req.local_track_mute.track_handle = self._ffi_handle.handle
124124
req.local_track_mute.mute = False

livekit-rtc/livekit/rtc/track_publication.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def track(self) -> Optional[RemoteTrack]:
106106
def subscribed(self) -> bool:
107107
return self._subscribed
108108

109-
def set_subscribed(self, subscribed: bool):
109+
def set_subscribed(self, subscribed: bool) -> None:
110110
req = proto_ffi.FfiRequest()
111111
req.set_subscribed.subscribe = subscribed
112112
req.set_subscribed.publication_handle = self._ffi_handle.handle

livekit-rtc/livekit/rtc/video_frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def __repr__(self) -> str:
202202
return f"rtc.VideoFrame(width={self.width}, height={self.height}, type={proto_video.VideoBufferType.Name(self.type)})"
203203

204204
@classmethod
205-
def __get_pydantic_core_schema__(cls, *_: Any):
205+
def __get_pydantic_core_schema__(cls, *_: Any) -> Any:
206206
from pydantic_core import core_schema
207207
import base64
208208

livekit-rtc/livekit/rtc/video_stream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def __init__(
4444
loop: Optional[asyncio.AbstractEventLoop] = None,
4545
capacity: int = 0,
4646
format: Optional[proto_video_frame.VideoBufferType.ValueType] = None,
47-
**kwargs,
47+
**kwargs: Any,
4848
) -> None:
4949
self._loop = loop or asyncio.get_event_loop()
5050
self._ffi_queue = FfiClient.instance.queue.subscribe(self._loop)

0 commit comments

Comments
 (0)