]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Remove unneeded str conversion; fix comment typo.
authorBob Halley <halley@dnspython.org>
Mon, 20 Jul 2020 13:12:19 +0000 (06:12 -0700)
committerBob Halley <halley@dnspython.org>
Mon, 20 Jul 2020 13:18:43 +0000 (06:18 -0700)
dns/resolver.py

index b259b907d1749d11e238266123c5c26c95bf15c8..bad24dc7d422981cc9e3a2305a56dcd57197d62e 100644 (file)
@@ -81,6 +81,9 @@ class NXDOMAIN(dns.exception.DNSException):
         IN = dns.rdataclass.IN
         CNAME = dns.rdatatype.CNAME
         cname = None
+        # This code assumes the CNAME chain is in proper order, though
+        # the Answer code does not make a similar assumption when
+        # chaining.
         for qname in self.kwargs['qnames']:
             response = self.kwargs['responses'][qname]
             for answer in response.answer:
@@ -1181,13 +1184,11 @@ class Resolver:
         *name*, a ``dns.name.Name`` or ``str``, the query name.
 
         This method can raise any exception that ``resolve()`` can
-        raise, other than `dns.resolver.NoAnswer`` and
+        raise, other than ``dns.resolver.NoAnswer`` and
         ``dns.resolver.NXDOMAIN``.
 
         Returns a ``dns.name.Name``.
         """
-        if isinstance(name, str):
-            name = dns.name.from_text(name)
         try:
             answer = self.resolve(name, raise_on_no_answer=False)
             canonical_name = answer.canonical_name