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

Serhiy Storchaka webhook-mailer at python.org
Fri Dec 7 09:48:32 EST 2018


https://github.com/python/cpython/commit/1133a8c0efabf6b33a169039cf6e2e03bfe6cfe3
commit: 1133a8c0efabf6b33a169039cf6e2e03bfe6cfe3
branch: master
author: Serhiy Storchaka <storchaka at gmail.com>
committer: GitHub <noreply at github.com>
date: 2018-12-07T16:48:21+02:00
summary:

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

files:
M Modules/_datetimemodule.c

diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
index 87a88be6090c..16c7bffda8f6 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 &&



More information about the Python-checkins mailing list