diff --git a/src/urllib3/connectionpool.py b/src/urllib3/connectionpool.py index d62f1f6642..db5ea8cebb 100644 --- a/src/urllib3/connectionpool.py +++ b/src/urllib3/connectionpool.py @@ -401,11 +401,11 @@ def _make_request( pass except Exception as e: print("ERROR=", e, e.args, "errno=", getattr(e, "errno", None)) - # Python 2, Windows + # Python 2, Windows, macOS # EPIPE and ESHUTDOWN are BrokenPipeError on Python 2, and EPROTOTYPE is needed on macOS # https://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/ # Windows is ConnectionAborted which can mean that a connection hung up. - if e.errno not in { + if getattr(e, "errno", None) not in { errno.EPIPE, errno.ESHUTDOWN, errno.EPROTOTYPE,