summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorƁukasz Langa <lukasz@langa.pl>2022-12-05 16:58:30 (GMT)
committerGitHub <noreply@github.com>2022-12-05 16:58:30 (GMT)
commitb914eee22246311869d0ce127b619b356a8dfb4a (patch)
tree891f3005861a4d15ca196eeb626e988ffc7b88d8 /Modules
parentc067023d878225ebe0b71eb55e7e98b272c4d5b2 (diff)
downloadcpython-b914eee22246311869d0ce127b619b356a8dfb4a.zip
cpython-b914eee22246311869d0ce127b619b356a8dfb4a.tar.gz
cpython-b914eee22246311869d0ce127b619b356a8dfb4a.tar.bz2
[3.10] gh-60203: Revert changes in cycle.__setstate__ (GH-99982) (#100017)
In case if only True/False be supported as boolean arguments in future, we should continue to support 1/0 here. (cherry picked from commit 922a6cf6c265e2763a003291885ff74d46203fc3) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Modules')
-rw-r--r--Modules/itertoolsmodule.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index f8e2c45..25c36e7 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -1204,6 +1204,7 @@ cycle_setstate(cycleobject *lz, PyObject *state)
PyErr_SetString(PyExc_TypeError, "state is not a tuple");
return NULL;
}
+ // The second item can be 1/0 in old pickles and True/False in new pickles
if (!PyArg_ParseTuple(state, "O!i", &PyList_Type, &saved, &firstpass)) {
return NULL;
}