Skip to content

Commit 5ddfccd

Browse files
committed
fix types
1 parent a4b89ac commit 5ddfccd

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

livekit-rtc/livekit/rtc/_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ def get_address(data) -> int:
4848
if isinstance(data, bytearray):
4949
return ctypes.addressof(ctypes.c_char.from_buffer(data))
5050
if isinstance(data, bytes):
51-
return ctypes.cast(ctypes.c_char_p(data), ctypes.c_void_p).value
51+
addr = ctypes.cast(ctypes.c_char_p(data), ctypes.c_void_p).value
52+
assert addr is not None
53+
return addr
5254
raise TypeError(f"expected bytes, bytearray, or memoryview, got {type(data)}")
5355

5456

livekit-rtc/livekit/rtc/audio_frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def __init__(
5050
ValueError: If the length of `data` is smaller than the required size.
5151
"""
5252
if isinstance(data, memoryview):
53-
data = data.obj
53+
data = data.obj # type: ignore[assignment]
5454

5555
min_size = num_channels * samples_per_channel * ctypes.sizeof(ctypes.c_int16)
5656
data_len = len(data)

0 commit comments

Comments
 (0)