diff --git a/bumble/transport/usb.py b/bumble/transport/usb.py index 53cc732..81e3750 100644 --- a/bumble/transport/usb.py +++ b/bumble/transport/usb.py @@ -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() diff --git a/examples/run_hfp_handsfree.py b/examples/run_hfp_handsfree.py index 3815fa4..efce3a2 100644 --- a/examples/run_hfp_handsfree.py +++ b/examples/run_hfp_handsfree.py @@ -275,18 +275,17 @@ async def main() -> None: output_file_name = sys.argv[5] global input_wav, output_wav - with ( - ( - wave.open(input_file_name, "rb") - if input_file_name - else contextlib.nullcontext(None) - ) as input_wav, - ( - wave.open(output_file_name, "wb") - if output_file_name - else contextlib.nullcontext(None) - ) as output_wav, - ): + input_cm: contextlib.AbstractContextManager[wave.Wave_read | None] = ( + wave.open(input_file_name, "rb") + if input_file_name + else contextlib.nullcontext(None) + ) + output_cm: contextlib.AbstractContextManager[wave.Wave_write | None] = ( + wave.open(output_file_name, "wb") + if output_file_name + else contextlib.nullcontext(None) + ) + with input_cm as input_wav, output_cm as output_wav: if input_wav and input_wav.getnchannels() != 1: print("Mono input required") return diff --git a/tasks.py b/tasks.py index 7d928cf..f0490f0 100644 --- a/tasks.py +++ b/tasks.py @@ -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.")