pymodbus-dev / pymodbus

A full modbus protocol written in python
Other
2.29k stars 938 forks source link

Eliminate more implicit optionals in transport #1873

Closed alexrudd2 closed 12 months ago

alexrudd2 commented 1 year ago

Instead of

if foo [is not None]:
  foo = None

use

if hasattr(self, 'foo'):
  del foo

Also, revert https://github.com/pymodbus-dev/pymodbus/pull/1859

pymodbus/transport/transport.py:255: error: "None" not callable [misc]

alexrudd2 commented 12 months ago

Closing in favor of https://github.com/pymodbus-dev/pymodbus/pull/1888