]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
include more detail when raising UnexpectedSource
authorBob Halley <halley@dnspython.org>
Wed, 1 Nov 2006 01:07:09 +0000 (01:07 +0000)
committerBob Halley <halley@dnspython.org>
Wed, 1 Nov 2006 01:07:09 +0000 (01:07 +0000)
dns/query.py

index 1e6d22ab95c0778a40e0614e2b4482eb04b5d61f..a257a81b714664bae0d710997a5eff6b0eab0b26 100644 (file)
@@ -115,7 +115,9 @@ def udp(q, where, timeout=None, port=53, af=None, source=None, source_port=0):
     finally:
         s.close()
     if from_address != destination:
-        raise UnexpectedSource
+        raise UnexpectedSource, \
+              'got a response from %s instead of %s' % (from_address,
+                                                        destination)
     r = dns.message.from_wire(wire, keyring=q.keyring, request_mac=q.mac)
     if not q.is_response(r):
         raise BadResponse