Ruff: Add and fix UP rules

This commit is contained in:
Josh Wu
2026-01-01 03:07:06 +08:00
parent 8e28f4e159
commit 3f643de4c1
102 changed files with 922 additions and 999 deletions

View File

@@ -16,7 +16,6 @@
# Imports
# -----------------------------------------------------------------------------
import logging
from typing import Optional, Union
import grpc.aio
@@ -44,7 +43,7 @@ logger = logging.getLogger(__name__)
# -----------------------------------------------------------------------------
async def open_android_emulator_transport(spec: Optional[str]) -> Transport:
async def open_android_emulator_transport(spec: str | None) -> Transport:
'''
Open a transport connection to an Android emulator via its gRPC interface.
The parameter string has this syntax:
@@ -89,7 +88,7 @@ async def open_android_emulator_transport(spec: Optional[str]) -> Transport:
logger.debug('connecting to gRPC server at %s', server_address)
channel = grpc.aio.insecure_channel(server_address)
service: Union[EmulatedBluetoothServiceStub, VhciForwardingServiceStub]
service: EmulatedBluetoothServiceStub | VhciForwardingServiceStub
if mode == 'host':
# Connect as a host
service = EmulatedBluetoothServiceStub(channel)