From b062edf392a70116031881f9af7a082d042a2dbd Mon Sep 17 00:00:00 2001 From: Ludovico Magnocavallo Date: Mon, 11 May 2009 13:39:59 +0200 Subject: [PATCH] disconnect when we cannot read from the socket --- client-libraries/python/redis.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client-libraries/python/redis.py b/client-libraries/python/redis.py index 881dfd1de..1787f171b 100644 --- a/client-libraries/python/redis.py +++ b/client-libraries/python/redis.py @@ -880,6 +880,9 @@ class Redis(object): def get_response(self): data = self._read().strip() + if not data: + self.disconnect() + raise ConnectionError("Socket closed on remote end") c = data[0] if c == '-': raise ResponseError(data[5:] if data[:5] == '-ERR ' else data[1:])