Skip to content

Commit

Permalink
stream.readchunk() bugfix: do not raise IndexError when buffer is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
jlacoline committed Jul 19, 2017
1 parent ffd6208 commit eef0800
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aiohttp/streams.py
Expand Up @@ -323,7 +323,9 @@ def readchunk(self):
if self._exception is not None:
raise self._exception

if not self._buffer and not self._eof:
if not self._buffer:
if self._eof:
return b""
yield from self._wait('readchunk')

return self._read_nowait_chunk(-1)
Expand Down

0 comments on commit eef0800

Please sign in to comment.