diff options
author | Constantine Evans <cevans@evanslabs.org> | 2017-05-08 19:33:57 -0700 |
---|---|---|
committer | Constantine Evans <cevans@evanslabs.org> | 2017-05-08 19:33:57 -0700 |
commit | bf964f169ac7dfa133dbae04d503af03e4d35265 (patch) | |
tree | cec2590f76724989cddaf6d9cd7681ae46f54134 /comments.py | |
parent | 8ec4cd173689eeb972da52701b1e1293d4121944 (diff) | |
download | ruamel.yaml-bf964f169ac7dfa133dbae04d503af03e4d35265.tar.gz |
fix __deepcopy__ class hardcoding in CommentedSeq and CommentedMap
Diffstat (limited to 'comments.py')
-rw-r--r-- | comments.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/comments.py b/comments.py index 307ec61..6bee2ac 100644 --- a/comments.py +++ b/comments.py @@ -428,7 +428,7 @@ class CommentedSeq(list, CommentedBase): def __deepcopy__(self, memo): # type: (Any) -> Any - res = CommentedSeq() + res = self.__class__() memo[id(self)] = res for k in self: res.append(copy.deepcopy(k)) @@ -861,7 +861,7 @@ class CommentedMap(ordereddict, CommentedBase): def __deepcopy__(self, memo): # type: (Any) -> Any - res = CommentedMap() + res = self.__class__() memo[id(self)] = res for k in self: res[k] = copy.deepcopy(self[k]) |