diff options
author | Ćukasz Langa <lukasz@langa.pl> | 2022-12-05 16:58:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-05 16:58:40 (GMT) |
commit | 32a2193f67aac1fc740d53f4de9205aa605a7017 (patch) | |
tree | d570bf43f32cd05726631d5eff8e5224830cff25 /Modules/itertoolsmodule.c | |
parent | 4a7612fbecbdd81a6e708e29aab0dc4c6555948d (diff) | |
download | cpython-32a2193f67aac1fc740d53f4de9205aa605a7017.zip cpython-32a2193f67aac1fc740d53f4de9205aa605a7017.tar.gz cpython-32a2193f67aac1fc740d53f4de9205aa605a7017.tar.bz2 |
[3.11] gh-60203: Revert changes in cycle.__setstate__ (GH-99982) (#100016)
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/itertoolsmodule.c')
-rw-r--r-- | Modules/itertoolsmodule.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index 4a7a957..d5cdfc5 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -1200,6 +1200,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; } |