summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2021-11-16 06:36:17 -0800
committerBob Halley <halley@dnspython.org>2021-11-16 06:36:17 -0800
commitabac716478847c4551e238ad8e25d01ba115f241 (patch)
treef1eb44ba058371514dec4675a2338c90231bfbb3
parentda5925a4063c5e7c13d84754a03bed1c5da7f208 (diff)
downloaddnspython-abac716478847c4551e238ad8e25d01ba115f241.tar.gz
fix session check when httpx is not installed
-rw-r--r--dns/query.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/dns/query.py b/dns/query.py
index 1111e08..314d8d8 100644
--- a/dns/query.py
+++ b/dns/query.py
@@ -328,7 +328,10 @@ def https(q, where, timeout=None, port=443, source=None, source_port=0,
transport_adapter = SourceAddressAdapter(source)
if session:
- _is_httpx = isinstance(session, httpx.Client)
+ if _have_httpx:
+ _is_httpx = isinstance(session, httpx.Client)
+ else:
+ _is_httpx = False
if _is_httpx and not _httpx_ok:
raise NoDOH('Session is httpx, but httpx cannot be used for '
'the requested operation.')