2323import re
2424import ssl
2525import warnings
26- from typing import Any , MutableMapping , Optional , Union
26+ from typing import Optional , TypedDict , Union
2727
2828from .._compat import warn_stacklevel
2929from .._exceptions import ConnectionError , ConnectionTimeout , SecurityWarning , TlsError
5555
5656 # See aio-libs/aiohttp#1769 and #5012
5757 _AIOHTTP_FIXED_HEAD_BUG = _AIOHTTP_SEMVER_VERSION >= (3 , 7 , 0 )
58+
59+ class RequestKwarg (TypedDict , total = False ):
60+ ssl : aiohttp .Fingerprint
61+
5862except ImportError : # pragma: nocover
5963 _AIOHTTP_AVAILABLE = False
6064 _AIOHTTP_META_VERSION = ""
@@ -170,7 +174,7 @@ async def perform_request( # type: ignore[override]
170174 else :
171175 body_to_send = None
172176
173- kwargs : MutableMapping [ str , Any ] = {}
177+ kwargs : RequestKwarg = {}
174178 if self ._ssl_assert_fingerprint :
175179 kwargs ["ssl" ] = aiohttp_fingerprint (self ._ssl_assert_fingerprint )
176180
@@ -182,7 +186,7 @@ async def perform_request( # type: ignore[override]
182186 data = body_to_send ,
183187 headers = request_headers ,
184188 timeout = aiohttp_timeout ,
185- ** kwargs , # type: ignore[arg-type]
189+ ** kwargs ,
186190 ) as response :
187191 if is_head : # We actually called 'GET' so throw away the data.
188192 await response .release ()
0 commit comments