Otherwise, the next self._connection.connect() call will not try again. In fact, it will do nothing. It won't raise the exception again. Therefore, closing the connection before retrying is mandatory.