http_client: immediately raise cancelled errors
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
94a11ff291
commit
cd520ba917
|
@ -274,6 +274,8 @@ class HttpClient:
|
||||||
header_callback=dl.on_headers_recd)
|
header_callback=dl.on_headers_recd)
|
||||||
timeout = connect_timeout + request_timeout + 1.
|
timeout = connect_timeout + request_timeout + 1.
|
||||||
resp = await asyncio.wait_for(fut, timeout)
|
resp = await asyncio.wait_for(fut, timeout)
|
||||||
|
except asyncio.CancelledError:
|
||||||
|
raise
|
||||||
except Exception:
|
except Exception:
|
||||||
if i + 1 == attempts:
|
if i + 1 == attempts:
|
||||||
raise
|
raise
|
||||||
|
|
Loading…
Reference in New Issue