Skip to content

Commit

Permalink
fix unnecessary cast
Browse files Browse the repository at this point in the history
[ci skip-jvm-tests]  # No JVM changes made.
  • Loading branch information
cosmicexplorer committed Mar 31, 2020
1 parent 67d2519 commit 8d644b0
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/python/pants/python/pex_build_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
from collections import defaultdict
from pathlib import Path
from typing import Callable, Dict, List, Optional, Sequence, Set, Tuple, cast
from typing import Callable, Dict, List, Optional, Sequence, Set, Tuple

from pex.interpreter import PythonIdentity, PythonInterpreter
from pex.pex_builder import PEXBuilder
Expand Down Expand Up @@ -216,16 +216,8 @@ def extract_single_dist_for_current_platform(self, reqs, dist_key) -> Distributi
"""
distributions = self.resolve_distributions(reqs, platforms=["current"])
try:
matched_dist = cast(
Distribution,
assert_single_element(
list(
dist
for dists in distributions.values()
for dist in dists
if dist.key == dist_key
)
),
matched_dist = assert_single_element(
dist for dists in distributions.values() for dist in dists if dist.key == dist_key
)
except (StopIteration, ValueError) as e:
raise self.SingleDistExtractionError(
Expand Down

0 comments on commit 8d644b0

Please sign in to comment.