Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions src/poetry/core/version/markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,15 +517,22 @@ def union_simplify(self, other: BaseMarker) -> BaseMarker | None:
return other

elif isinstance(other, MultiMarker):
markers = set(self._markers)
other_markers = set(other.markers)
common_markers = markers & other_markers
unique_markers = markers - common_markers
common_markers = [
marker for marker in self.markers if marker in other.markers
]

unique_markers = [
marker for marker in self.markers if marker not in common_markers
]
if not unique_markers:
return self
other_unique_markers = other_markers - common_markers

other_unique_markers = [
marker for marker in other.markers if marker not in common_markers
]
if not other_unique_markers:
return other

if common_markers:
unique_union = self.of(*unique_markers).union(
self.of(*other_unique_markers)
Expand Down