]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Concise URL instantiation. (#3364)
authorTom Christie <tom@tomchristie.com>
Fri, 25 Oct 2024 13:27:54 +0000 (14:27 +0100)
committerGitHub <noreply@github.com>
Fri, 25 Oct 2024 13:27:54 +0000 (14:27 +0100)
httpx/_models.py

index 01d9583bc5edd0e16fa1e8eadddd32e6039d762f..2ff22b487685d5c7e12b5b9a152e97fd17f72cac 100644 (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