mirror of https://github.com/pypa/pip
Move _fetch_metadata into _prepare
Since `_prepare` is called in two places, we preserve the `if self._dist is not None` protection above the new call to `_fetch_metadata`. The second `if` in `_prepare` handles the early return required when processing a lazy wheel.
This commit is contained in:
parent
4d94ae4c40
commit
8c3c0ade78
|
@ -216,6 +216,9 @@ class _InstallRequirementBackedCandidate(Candidate):
|
|||
|
||||
def _prepare(self):
|
||||
# type: () -> None
|
||||
if self._dist is not None:
|
||||
return
|
||||
self._fetch_metadata()
|
||||
if self._dist is not None:
|
||||
return
|
||||
try:
|
||||
|
@ -253,7 +256,6 @@ class _InstallRequirementBackedCandidate(Candidate):
|
|||
def dist(self):
|
||||
# type: () -> Distribution
|
||||
if self._dist is None:
|
||||
self._fetch_metadata()
|
||||
self._prepare()
|
||||
return self._dist
|
||||
|
||||
|
|
Loading…
Reference in New Issue