Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Commit

Permalink
checking if reader is None
Browse files Browse the repository at this point in the history
  • Loading branch information
vkhudiakova committed Aug 28, 2018
1 parent ea948d0 commit 3721dd3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion aioredis/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,10 @@ async def _read_data(self):
last_error = exc
break
else:
if (obj == b'' or obj is None) and self._reader.at_eof():
if (
(obj == b'' or obj is None) and
(self._reader is None or self._reader.at_eof())
):
logger.debug("Connection has been closed by server,"
" response: %r", obj)
last_error = ConnectionClosedError("Reader at end of file")
Expand Down

0 comments on commit 3721dd3

Please sign in to comment.