From fade7e45ebdfb564b9e8d69ebf5daeca81a03e1b Mon Sep 17 00:00:00 2001 From: Segev Finer Date: Fri, 29 Dec 2017 15:11:15 +0200 Subject: [PATCH] bpo-18035: telnetlib: select.error doesn't have an errno attribute select.error doesn't have an errno attribute so access the errno by indexing instead. --- Lib/telnetlib.py | 4 ++-- .../next/Library/2017-12-29-15-16-56.bpo-18035.c6rdCt.rst | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2017-12-29-15-16-56.bpo-18035.c6rdCt.rst diff --git a/Lib/telnetlib.py b/Lib/telnetlib.py index 2eaa8e3709861ac..d0246c0aea7d8ca 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 000000000000000..7b6e0dc6b282ede --- /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.