summaryrefslogtreecommitdiffstats
path: root/Lib/copy.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/copy.py')
-rw-r--r--Lib/copy.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/copy.py b/Lib/copy.py
index 0180554..77b7ad3 100644
--- a/Lib/copy.py
+++ b/Lib/copy.py
@@ -301,7 +301,10 @@ def _reconstruct(x, info, deep, memo=None):
if state:
if deep:
state = deepcopy(state, memo)
- y.__dict__.update(state)
+ if hasattr(y, '__setstate__'):
+ y.__setstate__(state)
+ else:
+ y.__dict__.update(state)
return y
del d