bpo-22005: Fix condition for unpickling a date object. (GH-11025)

This commit is contained in:
Serhiy Storchaka 2018-12-07 16:48:21 +02:00 committed by GitHub
parent cb0b78a070
commit 1133a8c0ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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 &&