MCPcopy Create free account
hub / github.com/rthalley/dnspython / _maybe_get_resolver

Function _maybe_get_resolver

dns/query.py:413–424  ·  view source on GitHub ↗
(
    resolver: Optional["dns.resolver.Resolver"],  # pyright: ignore
)

Source from the content-addressed store, hash-verified

411
412
413def _maybe_get_resolver(
414 resolver: Optional["dns.resolver.Resolver"], # pyright: ignore
415) -> "dns.resolver.Resolver": # pyright: ignore
416 # We need a separate method for this to avoid overriding the global
417 # variable "dns" with the as-yet undefined local variable "dns"
418 # in https().
419 if resolver is None:
420 # pylint: disable=import-outside-toplevel,redefined-outer-name
421 import dns.resolver
422
423 resolver = dns.resolver.Resolver()
424 return resolver
425
426
427class HTTPVersion(enum.IntEnum):

Callers 1

httpsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…