-2005-06-05 Bob Halley <halley@nominum.com>
+2005-07-31 Bob Halley <halley@dnspython.org>
+
+ * dns/message.py (make_response): Trying to respond to a response
+ threw a NameError while trying to throw a FormErr since it used
+ the wrong name for the FormErr exception.
+
+2005-06-05 Bob Halley <halley@dnspython.org>
* dns/query.py: The requirement that the "where" parameter be
an IPv4 or IPv6 address is now documented.
-2005-06-04 Bob Halley <halley@nominum.com>
+2005-06-04 Bob Halley <halley@dnspython.org>
* dns/resolver.py: The resolver now does exponential backoff
each time it runs through all of the nameservers.
@rtype: dns.message.Message object"""
if query.flags & dns.flags.QR:
- raise FormError, 'specified query message is not a query'
+ raise dns.exception.FormError, 'specified query message is not a query'
response = dns.message.Message(query.id)
response.flags = dns.flags.QR | (query.flags & dns.flags.RD)
if recursion_available:
m = dns.message.from_wire(badwire)
self.failUnlessRaises(dns.message.ShortHeader, bad)
+ def test_RespondingToResponse(self):
+ def bad():
+ q = dns.message.make_query('foo', 'A')
+ r1 = dns.message.make_response(q)
+ r2 = dns.message.make_response(r1)
+ self.failUnlessRaises(dns.exception.FormError, bad)
+
if __name__ == '__main__':
unittest.main()