diff --git a/CHANGES.rst b/CHANGES.rst index e32e3368d90..1c5f5685150 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -28,6 +28,8 @@ Changes - Connection can be destroyed before response get processed if `await aiohttp.request(..)` is used #1981 +- MultipartReader doesn't work with -OO #1969 + 2.1.0 (2017-05-26) ------------------ diff --git a/aiohttp/multipart.py b/aiohttp/multipart.py index 83201f21134..4f94845f7cb 100644 --- a/aiohttp/multipart.py +++ b/aiohttp/multipart.py @@ -282,7 +282,8 @@ def read_chunk(self, size=chunk_size): if self._read_bytes == self._length: self._at_eof = True if self._at_eof: - assert b'\r\n' == (yield from self._content.readline()), \ + clrf = yield from self._content.readline() + assert b'\r\n' == clrf, \ 'reader did not read all the data or it is malformed' return chunk