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 @@ -113,9 +113,8 @@ def __stream__(self) -> Iterator[_T]:
113113 response = self .response ,
114114 )
115115
116- # Ensure the entire stream is consumed
117- for _sse in iterator :
118- ...
116+ # As we might not fully consume the response stream, we need to close it explicitly
117+ response .close ()
119118
120119 def __enter__ (self ) -> Self :
121120 return self
@@ -231,9 +230,8 @@ async def __stream__(self) -> AsyncIterator[_T]:
231230 response = self .response ,
232231 )
233232
234- # Ensure the entire stream is consumed
235- async for _sse in iterator :
236- ...
233+ # As we might not fully consume the response stream, we need to close it explicitly
234+ await response .aclose ()
237235
238236 async def __aenter__ (self ) -> Self :
239237 return self
You can’t perform that action at this time.
0 commit comments