From 1133a8c0efabf6b33a169039cf6e2e03bfe6cfe3 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 7 Dec 2018 16:48:21 +0200 Subject: [PATCH] bpo-22005: Fix condition for unpickling a date object. (GH-11025) --- Modules/_datetimemodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index 87a88be6090..16c7bffda8f 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -2811,7 +2811,7 @@ date_new(PyTypeObject *type, PyObject *args, PyObject *kw) int day; /* Check for invocation from pickle with __getstate__ state */ - if (PyTuple_GET_SIZE(args) >= 1) { + if (PyTuple_GET_SIZE(args) == 1) { PyObject *state = PyTuple_GET_ITEM(args, 0); if (PyBytes_Check(state)) { if (PyBytes_GET_SIZE(state) == _PyDateTime_DATE_DATASIZE &&