From 9d8f94a7c83ee465c12f1e2216dec08ee979bc2c Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Tue, 27 Aug 2024 18:45:44 +0200 Subject: [PATCH] spack_yaml: delete custom deepcopy (#46048) --- lib/spack/spack/util/spack_yaml.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/lib/spack/spack/util/spack_yaml.py b/lib/spack/spack/util/spack_yaml.py index b3326d29591..d53f26350e0 100644 --- a/lib/spack/spack/util/spack_yaml.py +++ b/lib/spack/spack/util/spack_yaml.py @@ -14,7 +14,6 @@ """ import collections import collections.abc -import copy import ctypes import enum import functools @@ -400,20 +399,6 @@ def as_string(self, data) -> str: return result.getvalue() -def deepcopy(data): - """Returns a deepcopy of the input YAML data.""" - result = copy.deepcopy(data) - - if isinstance(result, comments.CommentedMap): - # HACK to fully copy ruamel CommentedMap that doesn't provide copy - # method. Especially necessary for environments - extracted_comments = extract_comments(data) - if extracted_comments: - set_comments(result, data_comments=extracted_comments) - - return result - - def load_config(str_or_file): """Load but modify the loader instance so that it will add __line__ attributes to the returned object."""