From: Guido van Rossum Date: Fri, 31 Jan 2003 21:10:31 +0000 (+0000) Subject: Ignore the state returned by __reduce__ if it is Py_None. X-Git-Tag: v2.3c1~2143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e0ad0cb0bec01a4216230d1003e24fe8c7ab3c7;p=thirdparty%2FPython%2Fcpython.git Ignore the state returned by __reduce__ if it is Py_None. --- diff --git a/Modules/cPickle.c b/Modules/cPickle.c index 24a9f131e7de..08bb8e8b2d90 100644 --- a/Modules/cPickle.c +++ b/Modules/cPickle.c @@ -2086,6 +2086,8 @@ save(Picklerobject *self, PyObject *args, int pers_save) if (size > 2) { state = PyTuple_GET_ITEM(t, 2); + if (state == Py_None) + state = NULL; } if (!( PyTuple_Check(arg_tup) || arg_tup==Py_None )) {