pymodbus-dev / pymodbus

A full modbus protocol written in python
Other
2.16k stars 891 forks source link

Cleanup dead resetFrame code #2082

Closed alexrudd2 closed 4 months ago

alexrudd2 commented 4 months ago

mypy flags the else branch as unreachable because the isinstance check always passes. I think this happened in https://github.com/pymodbus-dev/pymodbus/commit/ce67df9bf71c2a7ff8a7263fed1a602dfe49e935 but went unnoticed because the function isn't annotated.

https://github.com/pymodbus-dev/pymodbus/blob/214c7ed4ef27c686ad5d161b78477cc5aa6cb1cc/pymodbus/server/async_io.py#L162-L172

So this PR deletes the entire conditional, as well as the now-useless reset_frame flag.

Also, it cleans up the docstring mangled by https://github.com/pymodbus-dev/pymodbus/commit/18aa46349a0ceae65479b4b915f9657b3cb4854