spack_yaml: delete custom deepcopy (#46048)

This commit is contained in:
Harmen Stoppels 2024-08-27 18:45:44 +02:00 committed by GitHub
parent 1297673a70
commit 9d8f94a7c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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."""