add explanatory comment about skipping null chunks in iter_lines

This commit is contained in:
Vincent Barbaresi
2017-03-15 12:16:32 +01:00
parent cc2ac23c0d
commit 052595ffbf
+4 -1
View File
@@ -780,7 +780,10 @@ class Response(object):
for chunk in self.iter_content(chunk_size=chunk_size,
decode_unicode=decode_unicode):
# Skip any null responses
# Skip any null responses: if there is pending data it is necessarily an
# incomplete chunk, so if we don't have more data we don't want to bother
# trying to get it. Unconsumed pending data will be yielded anyway in the
# end of the loop if the stream ends.
if not chunk:
continue