Skip to content

Commit 1133a8c

Browse files
bpo-22005: Fix condition for unpickling a date object. (GH-11025)
1 parent cb0b78a commit 1133a8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/_datetimemodule.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2811,7 +2811,7 @@ date_new(PyTypeObject *type, PyObject *args, PyObject *kw)
28112811
int day;
28122812

28132813
/* Check for invocation from pickle with __getstate__ state */
2814-
if (PyTuple_GET_SIZE(args) >= 1) {
2814+
if (PyTuple_GET_SIZE(args) == 1) {
28152815
PyObject *state = PyTuple_GET_ITEM(args, 0);
28162816
if (PyBytes_Check(state)) {
28172817
if (PyBytes_GET_SIZE(state) == _PyDateTime_DATE_DATASIZE &&

0 commit comments

Comments
 (0)