summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/copy.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/copy.py b/Lib/copy.py
index a48e8c8..15e0e40 100644
--- a/Lib/copy.py
+++ b/Lib/copy.py
@@ -182,8 +182,12 @@ def _deepcopy_tuple(x, memo):
pass
for i in range(len(x)):
if x[i] is not y[i]:
- return tuple(y)
- return x
+ y = tuple(y)
+ break
+ else:
+ y = x
+ memo[d] = y
+ return y
d[types.TupleType] = _deepcopy_tuple
def _deepcopy_dict(x, memo):