From 576b6c082a02d06e0543458d84a1597c88fce0a4 Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Wed, 1 Nov 2006 01:07:09 +0000 Subject: [PATCH] include more detail when raising UnexpectedSource --- dns/query.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dns/query.py b/dns/query.py index 1e6d22ab..a257a81b 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 -- 2.47.3