diff --git a/src/paho/mqtt/client.py b/src/paho/mqtt/client.py index b22c173b..d329599d 100644 --- a/src/paho/mqtt/client.py +++ b/src/paho/mqtt/client.py @@ -4296,7 +4296,7 @@ def _recv_impl(self, length: int) -> bytes: else: raise BlockingIOError - except OSError: + except ConnectionError: self.connected = False return b''