diff options
author | Ovidiu Predescu <ovidiu@gmail.com> | 2011-08-30 23:11:28 -0700 |
---|---|---|
committer | Ovidiu Predescu <ovidiu@gmail.com> | 2011-08-30 23:11:28 -0700 |
commit | cd917ff68d369b617c8b6dcd268add51be0df859 (patch) | |
tree | ebc0c8a6cae1064696b3cba37b570e5e25682d26 /redis/connection.py | |
parent | 1736a9c94984879eddcccfb046968e36ab5f86f6 (diff) | |
download | redis-py-cd917ff68d369b617c8b6dcd268add51be0df859.tar.gz |
Raise ConnectionError if the reader has been closed under us. This
happens if someone calls the disconnect method. This matches the same
behavior as in PythonParser.
Diffstat (limited to 'redis/connection.py')
-rw-r--r-- | redis/connection.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/redis/connection.py b/redis/connection.py index 79f767e..61403a4 100644 --- a/redis/connection.py +++ b/redis/connection.py @@ -79,6 +79,8 @@ class HiredisParser(object): self._reader = None def read_response(self): + if not self._reader: + raise ConnectionError("Socket closed on remote end") response = self._reader.gets() while response is False: try: |