fix types

This commit is contained in:
Gilles Boccon-Gibod
2026-03-06 18:23:20 -08:00
parent 90560cdea1
commit b2893f26b6
3 changed files with 14 additions and 14 deletions

View File

@@ -222,9 +222,8 @@ def find_endpoints(device, forced_mode, sco_alternate=None):
class UsbPacketSink:
def __init__(self, device, bulk_out, isochronous_out):
def __init__(self, device, bulk_out, isochronous_out) -> None:
self.device = device
self.packets = asyncio.Queue[bytes]() # Queue of packets waiting to be sent
self.bulk_out = bulk_out
self.isochronous_out = isochronous_out
self.bulk_or_control_out_transfer = device.getTransfer()

View File

@@ -275,18 +275,17 @@ async def main() -> None:
output_file_name = sys.argv[5]
global input_wav, output_wav
with (
(
input_cm: contextlib.AbstractContextManager[wave.Wave_read | None] = (
wave.open(input_file_name, "rb")
if input_file_name
else contextlib.nullcontext(None)
) as input_wav,
(
)
output_cm: contextlib.AbstractContextManager[wave.Wave_write | None] = (
wave.open(output_file_name, "wb")
if output_file_name
else contextlib.nullcontext(None)
) as output_wav,
):
)
with input_cm as input_wav, output_cm as output_wav:
if input_wav and input_wav.getnchannels() != 1:
print("Mono input required")
return

View File

@@ -170,7 +170,9 @@ def format_code(ctx, check=False, diff=False):
@task
def check_types(ctx):
checklist = ["apps", "bumble", "examples", "tests", "tasks.py"]
print(">>> Running the type checker...")
try:
print("+++ Checking with mypy...")
ctx.run(f"mypy {' '.join(checklist)}")
except UnexpectedExit as exc:
print("Please check your code against the mypy messages.")