Skip to content

Commit

Permalink
Don't mutate template
Browse files Browse the repository at this point in the history
  • Loading branch information
atugushev committed Apr 8, 2022
1 parent eacc739 commit d4a6017
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pip/_internal/resolution/resolvelib/factory.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import contextlib
import copy
import functools
import logging
from typing import (
Expand Down Expand Up @@ -255,7 +256,7 @@ def _iter_found_candidates(
# "template". Here we just choose the first requirement to represent
# all of them.
# Hopefully the Project model can correct this mismatch in the future.
template = ireqs[0]
template = copy.deepcopy(ireqs[0])
assert template.req, "Candidates found on index must be PEP 508"
name = canonicalize_name(template.req.name)

Expand Down

0 comments on commit d4a6017

Please sign in to comment.