File tree Expand file tree Collapse file tree 2 files changed +52
-8
lines changed Expand file tree Collapse file tree 2 files changed +52
-8
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ def __init__(
19
19
self ,
20
20
url : str ,
21
21
headers : Dict ,
22
- timeout : int ,
23
- verify : bool = True ,
22
+ timeout : Optional [ int ] = None ,
23
+ verify : Optional [ bool ] = None ,
24
24
proxy : Optional [str ] = None ,
25
25
http_client : Optional [AsyncClient ] = None ,
26
26
):
@@ -32,6 +32,28 @@ def __init__(
32
32
** headers ,
33
33
}
34
34
35
+ if timeout is not None :
36
+ warn (
37
+ "The 'timeout' parameter is deprecated. Please configure it in the httpx client instead." ,
38
+ DeprecationWarning ,
39
+ stacklevel = 2 ,
40
+ )
41
+ if verify is not None :
42
+ warn (
43
+ "The 'verify' parameter is deprecated. Please configure it in the httpx client instead." ,
44
+ DeprecationWarning ,
45
+ stacklevel = 2 ,
46
+ )
47
+ if proxy is not None :
48
+ warn (
49
+ "The 'proxy' parameter is deprecated. Please configure it in the httpx client instead." ,
50
+ DeprecationWarning ,
51
+ stacklevel = 2 ,
52
+ )
53
+
54
+ self .verify = bool (verify ) if verify is not None else True
55
+ self .timeout = int (abs (timeout )) if timeout is not None else 60
56
+
35
57
if http_client is not None :
36
58
http_client .base_url = self .url
37
59
http_client .headers .update ({** self .headers })
@@ -40,8 +62,8 @@ def __init__(
40
62
self ._client = AsyncClient (
41
63
base_url = self .url ,
42
64
headers = self .headers ,
43
- verify = bool ( verify ) ,
44
- timeout = int ( abs ( timeout )) ,
65
+ verify = self . verify ,
66
+ timeout = self . timeout ,
45
67
proxy = proxy ,
46
68
follow_redirects = True ,
47
69
http2 = True ,
Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ def __init__(
19
19
self ,
20
20
url : str ,
21
21
headers : Dict ,
22
- timeout : int ,
23
- verify : bool = True ,
22
+ timeout : Optional [ int ] = None ,
23
+ verify : Optional [ bool ] = None ,
24
24
proxy : Optional [str ] = None ,
25
25
http_client : Optional [SyncClient ] = None ,
26
26
):
@@ -32,6 +32,28 @@ def __init__(
32
32
** headers ,
33
33
}
34
34
35
+ if timeout is not None :
36
+ warn (
37
+ "The 'timeout' parameter is deprecated. Please configure it in the httpx client instead." ,
38
+ DeprecationWarning ,
39
+ stacklevel = 2 ,
40
+ )
41
+ if verify is not None :
42
+ warn (
43
+ "The 'verify' parameter is deprecated. Please configure it in the httpx client instead." ,
44
+ DeprecationWarning ,
45
+ stacklevel = 2 ,
46
+ )
47
+ if proxy is not None :
48
+ warn (
49
+ "The 'proxy' parameter is deprecated. Please configure it in the httpx client instead." ,
50
+ DeprecationWarning ,
51
+ stacklevel = 2 ,
52
+ )
53
+
54
+ self .verify = bool (verify ) if verify is not None else True
55
+ self .timeout = int (abs (timeout )) if timeout is not None else 60
56
+
35
57
if http_client is not None :
36
58
http_client .base_url = self .url
37
59
http_client .headers .update ({** self .headers })
@@ -40,8 +62,8 @@ def __init__(
40
62
self ._client = SyncClient (
41
63
base_url = self .url ,
42
64
headers = self .headers ,
43
- verify = bool ( verify ) ,
44
- timeout = int ( abs ( timeout )) ,
65
+ verify = self . verify ,
66
+ timeout = self . timeout ,
45
67
proxy = proxy ,
46
68
follow_redirects = True ,
47
69
http2 = True ,
You can’t perform that action at this time.
0 commit comments