diff --git a/redshift_connector/core.py b/redshift_connector/core.py index 36d15b8..ba1a4c5 100644 --- a/redshift_connector/core.py +++ b/redshift_connector/core.py @@ -658,10 +658,7 @@ def get_calling_module() -> str: self._usock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) except socket.error as e: self._usock.close() - if socket.timeout: - raise OperationalError("connection time out", e) - else: - raise InterfaceError("communication error", e) + raise InterfaceError("communication error", e) self._flush: typing.Callable = self._sock.flush self._read: typing.Callable = self._sock.read self._write: typing.Callable = self._sock.write