File tree Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -34,13 +34,8 @@ class Auth:
3434
3535 async def request (self , method : str , path : str , ** kwargs ) -> ClientResponse:
3636 """ Make a request."""
37- headers = kwargs.get(" headers" )
38-
39- if headers is None :
40- headers = {}
41- else :
37+ if headers := kwargs.pop(" headers" , {}):
4238 headers = dict (headers)
43-
4439 headers[" authorization" ] = self .access_token
4540
4641 return await self .websession.request(
@@ -86,13 +81,8 @@ class Auth:
8681
8782 def request (self , method : str , path : str , ** kwargs ) -> requests.Response:
8883 """ Make a request."""
89- headers = kwargs.get(" headers" )
90-
91- if headers is None :
92- headers = {}
93- else :
84+ if headers := kwargs.pop(" headers" , {}):
9485 headers = dict (headers)
95-
9686 headers[" authorization" ] = self .access_token
9787
9888 return requests.request(
@@ -142,11 +132,7 @@ class AbstractAuth(ABC):
142132
143133 async def request (self , method , url , ** kwargs ) -> ClientResponse:
144134 """ Make a request."""
145- headers = kwargs.get(" headers" )
146-
147- if headers is None :
148- headers = {}
149- else :
135+ if headers := kwargs.pop(" headers" , {}):
150136 headers = dict (headers)
151137
152138 access_token = await self .async_get_access_token()
You can’t perform that action at this time.
0 commit comments