From: Brian Wellington Date: Tue, 28 Mar 2023 17:53:18 +0000 (-0700) Subject: Clean up the NoDOH exception. X-Git-Tag: v2.4.0rc1~36 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=842f0bbd85e39dae7eb396c788ad0ff77a1cf493;p=thirdparty%2Fdnspython.git Clean up the NoDOH exception. The docstring/default should refer to httpx, not requests, and the callers should use it rather than providing alternate (and different) strings. --- diff --git a/dns/asyncquery.py b/dns/asyncquery.py index a2bd06e1..97afa0b3 100644 --- a/dns/asyncquery.py +++ b/dns/asyncquery.py @@ -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") diff --git a/dns/query.py b/dns/query.py index 7ba3add1..c4bd75e3 100644 --- a/dns/query.py +++ b/dns/query.py @@ -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")