Skip to content

Commit

Permalink
Use yield from instead of looping yield (#6170)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Kirsche authored Jun 29, 2022
1 parent 0e28c8f commit 16b418b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions requests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,8 +813,7 @@ def generate():
# Special case for urllib3.
if hasattr(self.raw, "stream"):
try:
for chunk in self.raw.stream(chunk_size, decode_content=True):
yield chunk
yield from self.raw.stream(chunk_size, decode_content=True)
except ProtocolError as e:
raise ChunkedEncodingError(e)
except DecodeError as e:
Expand Down

0 comments on commit 16b418b

Please sign in to comment.