From 8e0ad0cb0bec01a4216230d1003e24fe8c7ab3c7 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 31 Jan 2003 21:10:31 +0000 Subject: Ignore the state returned by __reduce__ if it is Py_None. --- Modules/cPickle.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/cPickle.c b/Modules/cPickle.c index 24a9f13..08bb8e8 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 )) { -- cgit v0.12