summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2006-11-01 01:07:09 +0000
committerBob Halley <halley@dnspython.org>2006-11-01 01:07:09 +0000
commit576b6c082a02d06e0543458d84a1597c88fce0a4 (patch)
tree3075358758142443a6e82dd748ef4a0db2de0ab3
parent5c2908934dd59d3ee0abaf302cc5ded1d44000da (diff)
downloaddnspython-576b6c082a02d06e0543458d84a1597c88fce0a4.tar.gz
include more detail when raising UnexpectedSource
-rw-r--r--dns/query.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/dns/query.py b/dns/query.py
index 1e6d22a..a257a81 100644
--- a/dns/query.py
+++ b/dns/query.py
@@ -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