diff --git a/order/mixins.py b/order/mixins.py index ef2c033..4d9ba5f 100644 --- a/order/mixins.py +++ b/order/mixins.py @@ -11,6 +11,7 @@ ] +import sys import re import copy import collections @@ -294,7 +295,12 @@ def copy(self, *args, **kwargs): setattr(self, spec.src, ref_placeholder) # perform the deep copy operation - inst = copy.deepcopy(self) + orig_rec_limit = sys.getrecursionlimit() + try: + sys.setrecursionlimit(max(orig_rec_limit, 10000)) + inst = copy.deepcopy(self) + finally: + sys.setrecursionlimit(orig_rec_limit) # reset skipped attributes for spec, obj in skips.items(): diff --git a/order/util.py b/order/util.py index ab2cbd4..174b815 100644 --- a/order/util.py +++ b/order/util.py @@ -42,7 +42,7 @@ class typed(property): .. code-block:: python - class MyClass(object): + class MyClass(object): def __init__(self): self._foo = None