When dns.query.https() is passed a source address, it needs to create an
adapter for either requests or httpx to use it. As it doesn't know
which one will actually be used, it creates both. But then if it
decides to use httpx, it attempts to attach the requests adapter, which
fails.
else:
cm = requests.sessions.Session()
with cm as session:
- if transport_adapter:
+ if transport_adapter and not _is_httpx:
session.mount(url, transport_adapter)
# see https://tools.ietf.org/html/rfc8484#section-4.1.1 for DoH