]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
fix session check when httpx is not installed
authorBob Halley <halley@dnspython.org>
Tue, 16 Nov 2021 14:36:17 +0000 (06:36 -0800)
committerBob Halley <halley@dnspython.org>
Tue, 16 Nov 2021 14:36:17 +0000 (06:36 -0800)
dns/query.py

index 1111e089b76b92ed18fa91953aa34bc1be039ce6..314d8d83d9ac2781296a6edaf4cb3214c745269f 100644 (file)
@@ -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.')