Skip to content

Commit 63ccc28

Browse files
committed
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.
1 parent 5af0bc3 commit 63ccc28

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

news/85016e72-3c01-455a-ad4e-e25f676c7381.trivial

Whitespace-only changes.

src/pip/_internal/index.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from pip._vendor.packaging import specifiers
1717
from pip._vendor.packaging.utils import canonicalize_name
1818
from pip._vendor.packaging.version import parse as parse_version
19-
from pip._vendor.requests.exceptions import RetryError, SSLError
19+
from pip._vendor.requests.exceptions import HTTPError, RetryError, SSLError
2020
from pip._vendor.six.moves.urllib import parse as urllib_parse
2121
from pip._vendor.six.moves.urllib import request as urllib_request
2222

@@ -237,7 +237,7 @@ def _get_html_page(link, session=None):
237237
'Skipping page %s because the %s request got Content-Type: %s',
238238
link, exc.request_desc, exc.content_type,
239239
)
240-
except requests.HTTPError as exc:
240+
except HTTPError as exc:
241241
_handle_get_page_fail(link, exc)
242242
except RetryError as exc:
243243
_handle_get_page_fail(link, exc)

0 commit comments

Comments
 (0)