Skip to content
Myr

Rename 'close' to 'aclose' on Client (#675)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* Switch to aclose on Client * Fix reference to aclose in API docs

authored by Florimond Manca · committed by Tom Christie · parent f9d18a8 · Browse files · 3 files+6 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+6 added−6 removed

  • other:+6 added−6 removed

3 files+6 added−6 removed

modified:docs/advanced.md+2 added-2 removed
19 unmodified lines
20>>> r21<Response [200 OK]>22```2324Alternatively, you can explicitly close the connection pool without block-usage using `.close()`:24Alternatively, you can explicitly close the connection pool without block-usage using `.aclose()`:2526```python27>>> client = httpx.Client()28>>> try:29... r = await client.get('https://example.com')30... finally:31... await client.close()31... await client.aclose()32...33>>> r34<Response [200 OK]>35```
445 unmodified lines
modified:docs/api.md+1 added-1 removed
modified:httpx/client.py+3 added-3 removed
863 unmodified lines
864 timeout=timeout,865 trust_env=trust_env,866 )867868 async def close(self) -> None:868 async def aclose(self) -> None:869 await self.dispatch.close()870871 async def __aenter__(self) -> "Client":872 return self
3 unmodified lines
876 exc_type: typing.Type[BaseException] = None,877 exc_value: BaseException = None,878 traceback: TracebackType = None,879 ) -> None:880 await self.close()880 await self.aclose()881882883def _proxies_to_dispatchers(884 proxies: typing.Optional[ProxiesTypes],
70 unmodified lines
955 traceback: TracebackType = None,956 ) -> None:957 await self.response.aclose()958 if self.close_client:959 await self.client.close()959 await self.client.aclose()