@@ -548,14 +548,14 @@ def _build_request(
548548 # TODO: report this error to httpx
549549 return self ._client .build_request ( # pyright: ignore[reportUnknownMemberType]
550550 headers = headers ,
551- timeout = self .timeout if isinstance (options .timeout , NotGiven ) else options .timeout ,
551+ timeout = ( self .timeout if isinstance (options .timeout , NotGiven ) else options .timeout ) ,
552552 method = options .method ,
553553 url = prepared_url ,
554554 # the `Query` type that we use is incompatible with qs'
555555 # `Params` type as it needs to be typed as `Mapping[str, object]`
556556 # so that passing a `TypedDict` doesn't cause an error.
557557 # https://github.com/microsoft/pyright/issues/3526#event-6715453066
558- params = self .qs .stringify (cast (Mapping [str , Any ], params )) if params else None ,
558+ params = ( self .qs .stringify (cast (Mapping [str , Any ], params )) if params else None ) ,
559559 ** kwargs ,
560560 )
561561
@@ -1067,7 +1067,12 @@ def request(
10671067 )
10681068
10691069 def _sleep_for_retry (
1070- self , * , retries_taken : int , max_retries : int , options : FinalRequestOptions , response : httpx .Response | None
1070+ self ,
1071+ * ,
1072+ retries_taken : int ,
1073+ max_retries : int ,
1074+ options : FinalRequestOptions ,
1075+ response : httpx .Response | None ,
10711076 ) -> None :
10721077 remaining_retries = max_retries - retries_taken
10731078 if remaining_retries == 1 :
@@ -1248,7 +1253,11 @@ def post(
12481253 stream_cls : type [_StreamT ] | None = None ,
12491254 ) -> ResponseT | _StreamT :
12501255 opts = FinalRequestOptions .construct (
1251- method = "post" , url = path , json_data = body , files = to_httpx_files (files ), ** options
1256+ method = "post" ,
1257+ url = path ,
1258+ json_data = body ,
1259+ files = to_httpx_files (files ),
1260+ ** options ,
12521261 )
12531262 return cast (ResponseT , self .request (cast_to , opts , stream = stream , stream_cls = stream_cls ))
12541263
@@ -1273,7 +1282,11 @@ def put(
12731282 options : RequestOptions = {},
12741283 ) -> ResponseT :
12751284 opts = FinalRequestOptions .construct (
1276- method = "put" , url = path , json_data = body , files = to_httpx_files (files ), ** options
1285+ method = "put" ,
1286+ url = path ,
1287+ json_data = body ,
1288+ files = to_httpx_files (files ),
1289+ ** options ,
12771290 )
12781291 return self .request (cast_to , opts )
12791292
@@ -1317,6 +1330,7 @@ def __init__(self, **kwargs: Any) -> None:
13171330 class _DefaultAioHttpClient (httpx .AsyncClient ):
13181331 def __init__ (self , ** _kwargs : Any ) -> None :
13191332 raise RuntimeError ("To use the aiohttp client you must have installed the package with the `aiohttp` extra" )
1333+
13201334else :
13211335
13221336 class _DefaultAioHttpClient (httpx_aiohttp .HttpxAiohttpClient ): # type: ignore
@@ -1603,7 +1617,12 @@ async def request(
16031617 )
16041618
16051619 async def _sleep_for_retry (
1606- self , * , retries_taken : int , max_retries : int , options : FinalRequestOptions , response : httpx .Response | None
1620+ self ,
1621+ * ,
1622+ retries_taken : int ,
1623+ max_retries : int ,
1624+ options : FinalRequestOptions ,
1625+ response : httpx .Response | None ,
16071626 ) -> None :
16081627 remaining_retries = max_retries - retries_taken
16091628 if remaining_retries == 1 :
@@ -1772,7 +1791,11 @@ async def post(
17721791 stream_cls : type [_AsyncStreamT ] | None = None ,
17731792 ) -> ResponseT | _AsyncStreamT :
17741793 opts = FinalRequestOptions .construct (
1775- method = "post" , url = path , json_data = body , files = await async_to_httpx_files (files ), ** options
1794+ method = "post" ,
1795+ url = path ,
1796+ json_data = body ,
1797+ files = await async_to_httpx_files (files ),
1798+ ** options ,
17761799 )
17771800 return await self .request (cast_to , opts , stream = stream , stream_cls = stream_cls )
17781801
@@ -1797,7 +1820,11 @@ async def put(
17971820 options : RequestOptions = {},
17981821 ) -> ResponseT :
17991822 opts = FinalRequestOptions .construct (
1800- method = "put" , url = path , json_data = body , files = await async_to_httpx_files (files ), ** options
1823+ method = "put" ,
1824+ url = path ,
1825+ json_data = body ,
1826+ files = await async_to_httpx_files (files ),
1827+ ** options ,
18011828 )
18021829 return await self .request (cast_to , opts )
18031830
0 commit comments