Skip to content
Myr

Fix response.elapsed (#1313)

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

authored by Tom Christie · committed by GitHub · parent d25f2bf · Browse files · 1 file+2 added−2 removed
This commit

State

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

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:httpx/_client.py+2 added-2 removed
857 unmodified lines
858 ext={"timeout": timeout.as_dict()},859 )860861 def on_close(response: Response) -> None:862 response.elapsed = datetime.timedelta(timer.sync_elapsed())862 response.elapsed = datetime.timedelta(seconds=timer.sync_elapsed())863 if hasattr(stream, "close"):864 stream.close()865866 response = Response(
636 unmodified lines
1503 ext={"timeout": timeout.as_dict()},1504 )15051506 async def on_close(response: Response) -> None:1507 response.elapsed = datetime.timedelta(await timer.async_elapsed())1507 response.elapsed = datetime.timedelta(seconds=await timer.async_elapsed())1508 if hasattr(stream, "close"):1509 await stream.aclose()15101511 response = Response(
330 unmodified lines