]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Clean up the NoDOH exception.
authorBrian Wellington <bwelling@xbill.org>
Tue, 28 Mar 2023 17:53:18 +0000 (10:53 -0700)
committerBrian Wellington <bwelling@xbill.org>
Tue, 28 Mar 2023 17:53:18 +0000 (10:53 -0700)
The docstring/default should refer to httpx, not requests, and the
callers should use it rather than providing alternate (and different)
strings.

dns/asyncquery.py
dns/query.py

index a2bd06e108ba339f2bb1190494e1826376d65e1b..97afa0b35ac66bd6667596a24fa738f34a0cb830 100644 (file)
@@ -512,7 +512,7 @@ async def https(
     """
 
     if not have_doh:
-        raise NoDOH("httpx is not available.")  # pragma: no cover
+        raise NoDOH  # pragma: no cover
     if client and not isinstance(client, httpx.AsyncClient):
         raise ValueError("session parameter must be an httpx.AsyncClient")
 
index 7ba3add17f2651ab256b7d799bcf0bbc54defc39..c4bd75e3add08d334728d78d5cb7157823da48d1 100644 (file)
@@ -192,7 +192,7 @@ class BadResponse(dns.exception.FormError):
 
 
 class NoDOH(dns.exception.DNSException):
-    """DNS over HTTPS (DOH) was requested but the requests module is not
+    """DNS over HTTPS (DOH) was requested but the httpx module is not
     available."""
 
 
@@ -430,7 +430,7 @@ def https(
     """
 
     if not have_doh:
-        raise NoDOH("DNS-over-HTTPS is not available.")  # pragma: no cover
+        raise NoDOH  # pragma: no cover
     if session and not isinstance(session, httpx.Client):
         raise ValueError("session parameter must be an httpx.Client")