For the second one, mypy complains that we are passing asyncio.CancelledError to close which only takes Exception. As of Python 3.8 asyncio.CancelledError is dervied from BaseException instead. It will therefore not be caught or suppressed by anything acting on Exception.
The first commit is straightforward.
For the second one,
mypy
complains that we are passingasyncio.CancelledError
toclose
which only takesException
. As of Python 3.8asyncio.CancelledError
is dervied fromBaseException
instead. It will therefore not be caught or suppressed by anything acting onException
.https://github.com/pymodbus-dev/pymodbus/blob/7c4a310e10abfc17b42330c3474758b67e50dda8/pymodbus/transport/serialtransport.py#L53-L55
I don't see any use in passing it, so I just used
None
. The alternative is to justtype: ignore