summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Halley <halley@nominum.com>2011-05-02 21:00:19 +0100
committerBob Halley <halley@nominum.com>2011-05-02 21:00:19 +0100
commit987ee2c5ebe1cdafa740a64095a2c3e08c78d7c4 (patch)
treec07c039198b27747efca875f30c2d60e64b5f18e
parent0f741f3cc421c5237022e9121e3ca4cb7916fbc2 (diff)
downloaddnspython-987ee2c5ebe1cdafa740a64095a2c3e08c78d7c4.tar.gz
check errno values in exceptions in a way that works with python 3
-rw-r--r--dns/query.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/dns/query.py b/dns/query.py
index 5e01075..c41b444 100644
--- a/dns/query.py
+++ b/dns/query.py
@@ -110,7 +110,7 @@ def _wait_for(fd, readable, writable, error, expiration):
if not _polling_backend(fd, readable, writable, error, timeout):
raise dns.exception.Timeout
except select.error as e:
- if e.args[0] != errno.EINTR:
+ if e.errno != errno.EINTR:
raise e
done = True
@@ -247,9 +247,9 @@ def _connect(s, address):
s.connect(address)
except socket.error:
(ty, v) = sys.exc_info()[:2]
- if v[0] != errno.EINPROGRESS and \
- v[0] != errno.EWOULDBLOCK and \
- v[0] != errno.EALREADY:
+ if v.errno != errno.EINPROGRESS and \
+ v.errno != errno.EWOULDBLOCK and \
+ v.errno != errno.EALREADY:
raise v
def tcp(q, where, timeout=None, port=53, af=None, source=None, source_port=0,