spack_yaml: delete custom deepcopy (#46048)
This commit is contained in:
parent
1297673a70
commit
9d8f94a7c8
@ -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."""
|
||||
|
Loading…
Reference in New Issue
Block a user