From 16b418b44a04981ec452df607730079a6178a804 Mon Sep 17 00:00:00 2001 From: Kevin Kirsche Date: Tue, 28 Jun 2022 22:08:26 -0400 Subject: [PATCH] Use yield from instead of looping yield (#6170) --- requests/models.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/requests/models.py b/requests/models.py index 7e1522837f..3cd49f5bba 100644 --- a/requests/models.py +++ b/requests/models.py @@ -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: