Skip to content

Commit

Permalink
mypy 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
janiversen committed Jun 2, 2023
1 parent 0f6aa01 commit 6c9fcbf
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions pymodbus/transport/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,13 @@
import sys
from contextlib import suppress
from dataclasses import dataclass
from typing import Any, Callable, Coroutine, NewType
from typing import Any, Callable, Coroutine

from pymodbus.framer import ModbusFramer
from pymodbus.logging import Log
from pymodbus.transport.serial_asyncio import create_serial_connection


# Needed due to python 3.8 where Server is not defined
try:
from asyncio import Server as asyncio_server
except ImportError:
NewType("asyncio_server", Any)


class BaseTransport:
"""Base class for transport types.
Expand Down Expand Up @@ -96,7 +89,7 @@ def __init__(
)

self.reconnect_delay_current: float = 0
self.transport: asyncio.BaseTransport | asyncio_server = None
self.transport: asyncio.BaseTransport | asyncio.Server = None # type: ignore[attr-defined, unused-ignore]
self.protocol: asyncio.BaseProtocol = None
with suppress(RuntimeError):
self.loop: asyncio.AbstractEventLoop = asyncio.get_running_loop()
Expand Down

0 comments on commit 6c9fcbf

Please sign in to comment.