This is an automated email from the ASF dual-hosted git repository.
chug pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git
The following commit(s) were added to refs/heads/master by this push:
new 68b384f PROTON-2020: handle OSError in python 3
68b384f is described below
commit 68b384fb187a341e68a396e7d451a5bfacaee16a
Author: Chug <[email protected]>
AuthorDate: Tue Mar 26 08:09:36 2019 -0400
PROTON-2020: handle OSError in python 3
---
python/proton/_compat.py | 6 ++++--
python/proton/_io.py | 3 ++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/python/proton/_compat.py b/python/proton/_compat.py
index 4d9d070..7db8174 100644
--- a/python/proton/_compat.py
+++ b/python/proton/_compat.py
@@ -49,10 +49,11 @@ if PY3:
else:
raise v.with_traceback(tb)
-
def iteritems(d, **kw):
return iter(d.items(**kw))
+ def select_errno(e):
+ return e.errno
unichr = chr
else:
@@ -62,9 +63,10 @@ else:
raise t, v, tb
""")
-
def iteritems(d, **kw):
return d.iteritems(**kw)
+ def select_errno(e):
+ return e[0]
unichr = unichr
diff --git a/python/proton/_io.py b/python/proton/_io.py
index 9aa674e..97eba50 100644
--- a/python/proton/_io.py
+++ b/python/proton/_io.py
@@ -23,6 +23,7 @@ import errno
import socket
import select
import time
+from ._compat import select_errno
PN_INVALID_SOCKET = -1
@@ -135,7 +136,7 @@ class IO(object):
try:
r, w, _ = select_inner(timeout)
except select.error as e:
- if e[0] != errno.EINTR:
+ if select_errno(e) != errno.EINTR:
raise
r, w = ([], [])
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]