Skip to content
Myr

Use yield from instead of looping yield (#6170)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kevin Kirsche · committed by GitHub · parent 0e28c8f · Browse files · 1 file+1 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−2 removed

  • other:+1 added−2 removed

1 file+1 added−2 removed

modified:requests/models.py+1 added-2 removed
811 unmodified lines
812 def generate():813 # Special case for urllib3.814 if hasattr(self.raw, "stream"):815 try:816 for chunk in self.raw.stream(chunk_size, decode_content=True):817 yield chunk816 yield from self.raw.stream(chunk_size, decode_content=True)817 except ProtocolError as e:818 raise ChunkedEncodingError(e)819 except DecodeError as e:820 raise ContentDecodingError(e)
214 unmodified lines