Skip to content

Commit

Permalink
Don't duplicate output when raising out of distribution preparation
Browse files Browse the repository at this point in the history
  • Loading branch information
pradyunsg committed Jan 15, 2022
1 parent 5e0a7a0 commit 4ece2fd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/pip/_internal/resolution/resolvelib/candidates.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
from pip._vendor.packaging.utils import NormalizedName, canonicalize_name
from pip._vendor.packaging.version import Version

from pip._internal.exceptions import HashError, MetadataInconsistent
from pip._internal.exceptions import (
HashError,
InstallationSubprocessError,
MetadataInconsistent,
)
from pip._internal.metadata import BaseDistribution
from pip._internal.models.link import Link, links_equivalent
from pip._internal.models.wheel import Wheel
Expand Down Expand Up @@ -227,6 +231,11 @@ def _prepare(self) -> BaseDistribution:
# offending line to the user.
e.req = self._ireq
raise
except InstallationSubprocessError as exc:
# The output has been presented already, so don't duplicate it.
exc.context = "See above for output."
raise

self._check_metadata_consistency(dist)
return dist

Expand Down

0 comments on commit 4ece2fd

Please sign in to comment.