Skip to content

Commit 76954fa

Browse files
bluetechterencehonles
authored andcommitted
Pass through memo in __deepcopy__ as required by the docs (#6660)
This is needed to avoid problems with recursive loops. See https://docs.python.org/3.7/library/copy.html toward the end.
1 parent f4a59fd commit 76954fa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rest_framework/fields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ def __deepcopy__(self, memo):
614614
for item in self._args
615615
]
616616
kwargs = {
617-
key: (copy.deepcopy(value) if (key not in ('validators', 'regex')) else value)
617+
key: (copy.deepcopy(value, memo) if (key not in ('validators', 'regex')) else value)
618618
for key, value in self._kwargs.items()
619619
}
620620
return self.__class__(*args, **kwargs)

0 commit comments

Comments
 (0)