diff --git a/httpx/_urls.py b/httpx/_urls.py index a5cb72efca..2cd5ce2544 100644 --- a/httpx/_urls.py +++ b/httpx/_urls.py @@ -113,9 +113,7 @@ def __init__(self, url: URL | str = "", **kwargs: typing.Any) -> None: params = kwargs.pop("params") kwargs["query"] = None if not params else str(QueryParams(params)) - if isinstance(url, str): - self._uri_reference = urlparse(url, **kwargs) - elif isinstance(url, URL): + if isinstance(url, URL): self._uri_reference = url._uri_reference.copy_with(**kwargs) else: self._uri_reference = urlparse(str(url), **kwargs)