Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion httpcore/_async/connection_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,10 @@ async def __aiter__(self) -> typing.AsyncIterator[bytes]:
async for part in self._stream:
yield part
except BaseException as exc:
await self.aclose()
try:
await self.aclose()
except BaseException:
pass
raise exc from None

async def aclose(self) -> None:
Expand Down
5 changes: 4 additions & 1 deletion httpcore/_sync/connection_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,10 @@ def __iter__(self) -> typing.Iterator[bytes]:
for part in self._stream:
yield part
except BaseException as exc:
self.close()
try:
self.close()
except BaseException:
pass
raise exc from None

def close(self) -> None:
Expand Down
Loading