23
23
import re
24
24
import ssl
25
25
import warnings
26
- from typing import Any , MutableMapping , Optional , Union
26
+ from typing import Optional , TypedDict , Union
27
27
28
28
from .._compat import warn_stacklevel
29
29
from .._exceptions import ConnectionError , ConnectionTimeout , SecurityWarning , TlsError
55
55
56
56
# See aio-libs/aiohttp#1769 and #5012
57
57
_AIOHTTP_FIXED_HEAD_BUG = _AIOHTTP_SEMVER_VERSION >= (3 , 7 , 0 )
58
+
59
+ class RequestKwarg (TypedDict , total = False ):
60
+ ssl : aiohttp .Fingerprint
61
+
58
62
except ImportError : # pragma: nocover
59
63
_AIOHTTP_AVAILABLE = False
60
64
_AIOHTTP_META_VERSION = ""
@@ -170,7 +174,7 @@ async def perform_request( # type: ignore[override]
170
174
else :
171
175
body_to_send = None
172
176
173
- kwargs : MutableMapping [ str , Any ] = {}
177
+ kwargs : RequestKwarg = {}
174
178
if self ._ssl_assert_fingerprint :
175
179
kwargs ["ssl" ] = aiohttp_fingerprint (self ._ssl_assert_fingerprint )
176
180
@@ -182,7 +186,7 @@ async def perform_request( # type: ignore[override]
182
186
data = body_to_send ,
183
187
headers = request_headers ,
184
188
timeout = aiohttp_timeout ,
185
- ** kwargs , # type: ignore[arg-type]
189
+ ** kwargs ,
186
190
) as response :
187
191
if is_head : # We actually called 'GET' so throw away the data.
188
192
await response .release ()
0 commit comments