From 63ccc286a0783a685005cb3b9f62eccf65e30bc4 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Fri, 29 Mar 2019 10:17:31 -0700 Subject: [PATCH] Consistently catch exceptions in index.py In index.py we were catching requests.exceptions.RetryError and requests.exceptions.SSLError but then also caught requests.HTTPError. For consistency catch all of these requests exceptions using the requests.exceptions path. --- news/85016e72-3c01-455a-ad4e-e25f676c7381.trivial | 0 src/pip/_internal/index.py | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 news/85016e72-3c01-455a-ad4e-e25f676c7381.trivial diff --git a/news/85016e72-3c01-455a-ad4e-e25f676c7381.trivial b/news/85016e72-3c01-455a-ad4e-e25f676c7381.trivial new file mode 100644 index 000000000..e69de29bb diff --git a/src/pip/_internal/index.py b/src/pip/_internal/index.py index f251c4b58..8af659634 100644 --- a/src/pip/_internal/index.py +++ b/src/pip/_internal/index.py @@ -16,7 +16,7 @@ from pip._vendor.distlib.compat import unescape from pip._vendor.packaging import specifiers from pip._vendor.packaging.utils import canonicalize_name from pip._vendor.packaging.version import parse as parse_version -from pip._vendor.requests.exceptions import RetryError, SSLError +from pip._vendor.requests.exceptions import HTTPError, RetryError, SSLError from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._vendor.six.moves.urllib import request as urllib_request @@ -237,7 +237,7 @@ def _get_html_page(link, session=None): 'Skipping page %s because the %s request got Content-Type: %s', link, exc.request_desc, exc.content_type, ) - except requests.HTTPError as exc: + except HTTPError as exc: _handle_get_page_fail(link, exc) except RetryError as exc: _handle_get_page_fail(link, exc)