From 842f0bbd85e39dae7eb396c788ad0ff77a1cf493 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Tue, 28 Mar 2023 10:53:18 -0700 Subject: 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. --- dns/asyncquery.py | 2 +- dns/query.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dns/asyncquery.py b/dns/asyncquery.py index a2bd06e..97afa0b 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 7ba3add..c4bd75e 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") -- cgit v1.2.1