Skip to content

Commit

Permalink
Merge pull request #10537 from pradyunsg/fix-misbehaving-test
Browse files Browse the repository at this point in the history
pradyunsg authored Dec 5, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents ebc13b4 + 4cdf146 commit bbc7021
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/pip/_internal/index/package_finder.py
Original file line number Diff line number Diff line change
@@ -37,7 +37,6 @@
from pip._internal.utils.misc import build_netloc
from pip._internal.utils.packaging import check_requires_python
from pip._internal.utils.unpacking import SUPPORTED_EXTENSIONS
from pip._internal.utils.urls import url_to_path

__all__ = ["FormatControl", "BestCandidateResult", "PackageFinder"]

@@ -816,7 +815,14 @@ def find_all_candidates(self, project_name: str) -> List[InstallationCandidate]:
)

if logger.isEnabledFor(logging.DEBUG) and file_candidates:
paths = [url_to_path(c.link.url) for c in file_candidates]
paths = []
for candidate in file_candidates:
assert candidate.link.url # we need to have a URL
try:
paths.append(candidate.link.file_path)
except Exception:
paths.append(candidate.link.url) # it's not a local file

logger.debug("Local files found: %s", ", ".join(paths))

# This is an intentional priority ordering

0 comments on commit bbc7021

Please sign in to comment.