diff options
author | Bob Halley <halley@dnspython.org> | 2021-11-16 06:36:17 -0800 |
---|---|---|
committer | Bob Halley <halley@dnspython.org> | 2021-11-16 06:36:17 -0800 |
commit | abac716478847c4551e238ad8e25d01ba115f241 (patch) | |
tree | f1eb44ba058371514dec4675a2338c90231bfbb3 | |
parent | da5925a4063c5e7c13d84754a03bed1c5da7f208 (diff) | |
download | dnspython-abac716478847c4551e238ad8e25d01ba115f241.tar.gz |
fix session check when httpx is not installed
-rw-r--r-- | dns/query.py | 5 |
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.') |