Skip to content

Commit

Permalink
prefer requirement.clone()
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby committed Jun 5, 2022
1 parent 5cc68a1 commit 9e9c32c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/poetry/packages/locker.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import os
import re

from copy import deepcopy
from hashlib import sha256
from pathlib import Path
from typing import TYPE_CHECKING
Expand Down Expand Up @@ -341,7 +340,7 @@ def __walk_dependencies(
for region_marker in region_markers:
marker = region_marker.intersect(base_marker)
if not marker.is_empty():
require2 = deepcopy(require)
require2 = require.clone()
require2.marker = marker
dependencies.append(require2)

Expand Down Expand Up @@ -393,7 +392,7 @@ def get_project_dependency_packages(
if project_python_marker is not None:
marked_requires: list[Dependency] = []
for require in project_requires:
require = deepcopy(require)
require = require.clone()
require.marker = require.marker.intersect(project_python_marker)
marked_requires.append(require)
project_requires = marked_requires
Expand Down

0 comments on commit 9e9c32c

Please sign in to comment.