python 3.9 compat

This commit is contained in:
Gilles Boccon-Gibod
2025-09-26 08:42:10 +02:00
parent aa1d7933da
commit 6a3eaa457f

View File

@@ -17,6 +17,7 @@
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
import asyncio import asyncio
import logging import logging
from typing import Optional
import serial_asyncio import serial_asyncio
@@ -51,7 +52,7 @@ class SerialPacketSource(StreamPacketSource):
logger.debug('connection made') logger.debug('connection made')
self._ready.set() self._ready.set()
def connection_lost(self, exc: Exception | None) -> None: def connection_lost(self, exc: Optional[Exception]) -> None:
logger.debug('connection lost') logger.debug('connection lost')
self.on_transport_lost() self.on_transport_lost()