From 33f8a422ebffcd9ee04aead7e3d1756a05609dfe Mon Sep 17 00:00:00 2001 From: Bakyt Niiazaliev Date: Mon, 7 Jul 2025 20:18:27 +0700 Subject: [PATCH] feat: reintroduce InvalidURL exception class with constructor in _httpx module --- python/httpx/_exceptions.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/python/httpx/_exceptions.py b/python/httpx/_exceptions.py index dd7fb6cd..d01457e0 100644 --- a/python/httpx/_exceptions.py +++ b/python/httpx/_exceptions.py @@ -36,6 +36,8 @@ from __future__ import annotations import contextlib import typing +from ._httpx import InvalidURL + if typing.TYPE_CHECKING: from ._models import Request, Response # pragma: no cover @@ -268,15 +270,6 @@ class HTTPStatusError(HTTPError): self.response = response -class InvalidURL(Exception): - """ - URL is improperly formed or cannot be parsed. - """ - - def __init__(self, message: str) -> None: - super().__init__(message) - - class CookieConflict(Exception): """ Attempted to lookup a cookie by name, but multiple cookies existed.