How to suppress Depreciation warnings for pymodbus asyncio

131 Views Asked by At

We're using a third party library which still uses the old @asyncio.coroutine decorator and is generating a bunch of warnings on import. I recognise this will break in future versions of python. But for now we just want to turn off this warning so that it doesn't spam the user.

I've tried everything I can think of to silence this including every answer here and even turning off all depreciation warnings:

warnings.filterwarnings("ignore", category=DeprecationWarning)

from pymodbus.client.asynchronous.async_io import (
    BaseModbusAsyncClientProtocol,
    ReconnectingAsyncioModbusTcpClient,
    ReconnectingAsyncioModbusTlsClient,
)

Nothing seems to silence it.

0

There are 0 best solutions below