]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
When raising NoAnswer from a cache hit, supply the response.
authorBob Halley <halley@dnspython.org>
Mon, 26 Sep 2016 15:51:25 +0000 (08:51 -0700)
committerBob Halley <halley@dnspython.org>
Mon, 26 Sep 2016 15:51:25 +0000 (08:51 -0700)
[Issue #206]

dns/resolver.py

index f6ab64f6e68e9d2de5f8a7544c3f69334c80cbce..aaf93fe26effb1177e06a69282a7f0eae8ce91c6 100644 (file)
@@ -922,7 +922,7 @@ class Resolver(object):
                 answer = self.cache.get((_qname, rdtype, rdclass))
                 if answer is not None:
                     if answer.rrset is None and raise_on_no_answer:
-                        raise NoAnswer
+                        raise NoAnswer(response=answer.response)
                     else:
                         return answer
             request = dns.message.make_query(_qname, rdtype, rdclass)