summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConstantine Evans <cevans@evanslabs.org>2017-05-08 19:33:57 -0700
committerConstantine Evans <cevans@evanslabs.org>2017-05-08 19:33:57 -0700
commitbf964f169ac7dfa133dbae04d503af03e4d35265 (patch)
treecec2590f76724989cddaf6d9cd7681ae46f54134
parent8ec4cd173689eeb972da52701b1e1293d4121944 (diff)
downloadruamel.yaml-bf964f169ac7dfa133dbae04d503af03e4d35265.tar.gz
fix __deepcopy__ class hardcoding in CommentedSeq and CommentedMap
-rw-r--r--comments.py4
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])