diff options
Diffstat (limited to 'Modules/cPickle.c')
-rw-r--r-- | Modules/cPickle.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/Modules/cPickle.c b/Modules/cPickle.c index dc98772..6af99ba 100644 --- a/Modules/cPickle.c +++ b/Modules/cPickle.c @@ -2143,6 +2143,12 @@ save_reduce(Picklerobject *self, PyObject *args, PyObject *ob) &dictitems)) return -1; + if (!PyTuple_Check(argtup)) { + PyErr_SetString(PicklingError, + "args from reduce() should be a tuple"); + return -1; + } + if (state == Py_None) state = NULL; if (listitems == Py_None) @@ -3616,17 +3622,6 @@ Instance_New(PyObject *cls, PyObject *args) else goto err; } - if (args==Py_None) { - /* Special case, call cls.__basicnew__() */ - PyObject *basicnew; - - basicnew = PyObject_GetAttr(cls, __basicnew___str); - if (!basicnew) return NULL; - r=PyObject_CallObject(basicnew, NULL); - Py_DECREF(basicnew); - if (r) return r; - } - if ((r=PyObject_CallObject(cls, args))) return r; err: |