diff options
author | Raymond Hettinger <python@rcn.com> | 2004-12-07 07:05:57 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2004-12-07 07:05:57 (GMT) |
commit | a6b45cc31d33c166c84866f78d504a99d409895c (patch) | |
tree | daffa37b19305cdf19902242a177ed436e396fb1 /Modules/cPickle.c | |
parent | 84667c063a1e93a985134f7cef376edf82941c02 (diff) | |
download | cpython-a6b45cc31d33c166c84866f78d504a99d409895c.zip cpython-a6b45cc31d33c166c84866f78d504a99d409895c.tar.gz cpython-a6b45cc31d33c166c84866f78d504a99d409895c.tar.bz2 |
Eliminate the deprecated option to return None instead of a tuple of arguments in __reduce__().
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: |