Concise URL instantiation. (#3364)

This commit is contained in:
Tom Christie 2024-10-25 14:27:54 +01:00 committed by GitHub
parent 6f9b50990d
commit 3f76571d34
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -328,9 +328,7 @@ class Request:
if isinstance(method, bytes)
else method.upper()
)
self.url = URL(url)
if params is not None:
self.url = self.url.copy_merge_params(params=params)
self.url = URL(url) if params is None else URL(url, params=params)
self.headers = Headers(headers)
self.extensions = {} if extensions is None else extensions