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
Валентина Худякова committed Aug 28, 2018
1 parent ea948d0 commit 4ccce09
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

1 comment on commit 4ccce09

@webknjaz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW you did this commit with email, which is not bound to GitHub. You might want to fix this.

Please sign in to comment.