Skip to content

Commit b3e637e

Browse files
committed
move fix from relation() to _register()
1 parent 6394205 commit b3e637e

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/poetry/mixology/partial_solution.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,15 @@ def _register(self, assignment: Assignment) -> None:
146146
"""
147147
name = assignment.dependency.complete_name
148148
old_positive = self._positive.get(name)
149+
if old_positive is None and assignment.dependency.features:
150+
old_positive_without_features = self._positive.get(
151+
assignment.dependency.name
152+
)
153+
if old_positive_without_features is not None:
154+
dep = old_positive_without_features.dependency.with_features(
155+
assignment.dependency.features
156+
)
157+
old_positive = Term(dep, is_positive=True)
149158
if old_positive is not None:
150159
value = old_positive.intersect(assignment)
151160
assert value is not None
@@ -213,13 +222,6 @@ def relation(self, term: Term) -> str:
213222
if positive is not None:
214223
return positive.relation(term)
215224

216-
positive = self._positive.get(term.dependency.name)
217-
if positive is not None:
218-
dep = positive.dependency.with_features(term.dependency.features)
219-
positive_with_features = Term(dep, is_positive=True)
220-
self._positive[term.dependency.complete_name] = positive_with_features
221-
return positive_with_features.relation(term)
222-
223225
by_ref = self._negative.get(term.dependency.complete_name)
224226
if by_ref is None:
225227
return SetRelation.OVERLAPPING

0 commit comments

Comments
 (0)