Skip to content

Commit

Permalink
Improve warning message for invalid vcs schemes
Browse files Browse the repository at this point in the history
  • Loading branch information
deveshks committed Jun 28, 2020
1 parent 8d7af2d commit 46790a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/pip/_internal/index/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,8 @@ def _get_html_page(link, session=None):
# Check for VCS schemes that do not support lookup as web pages.
vcs_scheme = _match_vcs_scheme(url)
if vcs_scheme:
logger.warning('Cannot look at %s URL %s', vcs_scheme, link)
logger.warning('Cannot look at %s URL %s because it does not support '
'lookup as web pages.', vcs_scheme, link)
return None

# Tack index.html onto file:// URLs that point to directories
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,8 @@ def test_get_html_page_invalid_scheme(caplog, url, vcs_scheme):
(
"pip._internal.index.collector",
logging.WARNING,
"Cannot look at {} URL {}".format(vcs_scheme, url),
"Cannot look at {} URL {} because it does not support "
"lookup as web pages.".format(vcs_scheme, url),
),
]

Expand Down

0 comments on commit 46790a4

Please sign in to comment.