]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Clean up keyword argument name, using URL.join(url=...), not URL.join(relative_url...
authorTom Christie <tom@tomchristie.com>
Wed, 5 Aug 2020 17:32:34 +0000 (18:32 +0100)
committerGitHub <noreply@github.com>
Wed, 5 Aug 2020 17:32:34 +0000 (18:32 +0100)
* URL.join(url=...), not URL.join(relative_url=...)

* Fix URL.join()

httpx/_client.py
httpx/_models.py

index dad4a42aab0912f805dc0c3bd35d63490fd78bfb..0a2e525a2f68d98e78b8f4e8643209a41d81bf5c 100644 (file)
@@ -208,7 +208,7 @@ class BaseClient:
         Merge a URL argument together with any 'base_url' on the client,
         to create the URL used for the outgoing request.
         """
-        return self.base_url.join(relative_url=url)
+        return self.base_url.join(url)
 
     def _merge_cookies(
         self, cookies: CookieTypes = None
index 9c5aa1773a241f9e62579e25514728bfd0c2176e..41c7a274e6a628d27b5760a3194410c4b643118f 100644 (file)
@@ -183,17 +183,17 @@ class URL:
 
         return URL(self._uri_reference.copy_with(**kwargs).unsplit(),)
 
-    def join(self, relative_url: URLTypes) -> "URL":
+    def join(self, url: URLTypes) -> "URL":
         """
         Return an absolute URL, using given this URL as the base.
         """
         if self.is_relative_url:
-            return URL(relative_url)
+            return URL(url)
 
         # We drop any fragment portion, because RFC 3986 strictly
         # treats URLs with a fragment portion as not being absolute URLs.
         base_uri = self._uri_reference.copy_with(fragment=None)
-        relative_url = URL(relative_url)
+        relative_url = URL(url)
         return URL(relative_url._uri_reference.resolve_with(base_uri).unsplit())
 
     def __hash__(self) -> int: