File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -96,9 +96,8 @@ def __stream__(self) -> Iterator[_T]:
9696
9797 yield process_data (data = data , cast_to = cast_to , response = response )
9898
99- # Ensure the entire stream is consumed
100- for _sse in iterator :
101- ...
99+ # As we might not fully consume the response stream, we need to close it explicitly
100+ response .close ()
102101
103102 def __enter__ (self ) -> Self :
104103 return self
@@ -198,9 +197,8 @@ async def __stream__(self) -> AsyncIterator[_T]:
198197
199198 yield process_data (data = data , cast_to = cast_to , response = response )
200199
201- # Ensure the entire stream is consumed
202- async for _sse in iterator :
203- ...
200+ # As we might not fully consume the response stream, we need to close it explicitly
201+ await response .aclose ()
204202
205203 async def __aenter__ (self ) -> Self :
206204 return self
You can’t perform that action at this time.
0 commit comments