diff --git a/Lib/telnetlib.py b/Lib/telnetlib.py index 2eaa8e3709861a..d0246c0aea7d8c 100644 --- a/Lib/telnetlib.py +++ b/Lib/telnetlib.py @@ -317,7 +317,7 @@ def _read_until_with_poll(self, match, timeout): ready = poller.poll(None if timeout is None else 1000 * call_timeout) except select.error as e: - if e.errno == errno.EINTR: + if e[0] == errno.EINTR: if timeout is not None: elapsed = time() - time_start call_timeout = timeout-elapsed @@ -688,7 +688,7 @@ def _expect_with_poll(self, expect_list, timeout=None): ready = poller.poll(None if timeout is None else 1000 * call_timeout) except select.error as e: - if e.errno == errno.EINTR: + if e[0] == errno.EINTR: if timeout is not None: elapsed = time() - time_start call_timeout = timeout-elapsed diff --git a/Misc/NEWS.d/next/Library/2017-12-29-15-16-56.bpo-18035.c6rdCt.rst b/Misc/NEWS.d/next/Library/2017-12-29-15-16-56.bpo-18035.c6rdCt.rst new file mode 100644 index 00000000000000..7b6e0dc6b282ed --- /dev/null +++ b/Misc/NEWS.d/next/Library/2017-12-29-15-16-56.bpo-18035.c6rdCt.rst @@ -0,0 +1,2 @@ +``telnetlib``: ``select.error`` doesn't have an ``errno`` attribute. Patch +by Segev Finer.