summaryrefslogtreecommitdiffstats
path: root/Lib/copy.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-06-10 14:00:19 (GMT)
committerGitHub <noreply@github.com>2022-06-10 14:00:19 (GMT)
commitc3045d809c284a2eb6b54b21ee88b56281cf8378 (patch)
tree811fd27095783401663dccfd82363fd8d98c25b7 /Lib/copy.py
parent516d90eb215315a120e0a7168db68540321bb478 (diff)
downloadcpython-c3045d809c284a2eb6b54b21ee88b56281cf8378.zip
cpython-c3045d809c284a2eb6b54b21ee88b56281cf8378.tar.gz
cpython-c3045d809c284a2eb6b54b21ee88b56281cf8378.tar.bz2
gh-90494: Reject 6th element of the __reduce__() tuple (GH-93609) (GH-93631)
copy.copy() and copy.deepcopy() now always raise a TypeError if __reduce__() returns a tuple with length 6 instead of silently ignore the 6th item or produce incorrect result. (cherry picked from commit a365dd64c2a1f0d142540d5031003f24986f489f) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib/copy.py')
-rw-r--r--Lib/copy.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/copy.py b/Lib/copy.py
index 69bac98..1b276af 100644
--- a/Lib/copy.py
+++ b/Lib/copy.py
@@ -258,7 +258,7 @@ def _keep_alive(x, memo):
def _reconstruct(x, memo, func, args,
state=None, listiter=None, dictiter=None,
- deepcopy=deepcopy):
+ *, deepcopy=deepcopy):
deep = memo is not None
if deep and args:
args = (deepcopy(arg, memo) for arg in args)