From bb29979e2a798a7a63b303ea717b83d5697dafd3 Mon Sep 17 00:00:00 2001 From: Wes Turner <50891+westurner@users.noreply.github.com> Date: Sat, 11 Jan 2020 00:47:11 -0500 Subject: [PATCH] BUG: timeout argument / kwarg passthrough At a glance, should the timeout parameter pass through to client.request / http.request in kwargs? --- requests3/core/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/requests3/core/__init__.py b/requests3/core/__init__.py index 03c76e2b..6ee9faa0 100644 --- a/requests3/core/__init__.py +++ b/requests3/core/__init__.py @@ -6,7 +6,7 @@ async def request( method, url, - timeout, + timeout, # should this pass through? *, data=None, headers=None, @@ -17,6 +17,7 @@ async def request( """Returns a Response object, to be awaited.""" if not client: client = http3.AsyncClient() + kwargs['timeout'] = kwargs.get('timeout', timeout) return await client.request( method=method, url=url, @@ -30,7 +31,7 @@ async def request( def blocking_request( method, url, - timeout, + timeout, # should this pass through? *, data=None, headers=None, @@ -41,6 +42,7 @@ def blocking_request( """Returns a Response object.""" if not client: client = http3.Client() + kwargs['timeout'] = kwargs.get('timeout', timeout) with client as http: r = http.request( method=method,