Skip to content

Commit

Permalink
Close proxy dispatch classes on Client.close() (#826)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchristie authored Feb 27, 2020
1 parent 19555f6 commit 2714f32
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions httpx/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,8 @@ def delete(

def close(self) -> None:
self.dispatch.close()
for proxy in self.proxies.values():
proxy.close()

def __enter__(self) -> "Client":
return self
Expand Down Expand Up @@ -1388,6 +1390,8 @@ async def delete(

async def aclose(self) -> None:
await self.dispatch.close()
for proxy in self.proxies.values():
await proxy.close()

async def __aenter__(self) -> "AsyncClient":
return self
Expand Down

0 comments on commit 2714f32

Please sign in to comment.