save(): Reformat tail end just for clarity.
This commit is contained in:
parent
18e36f4576
commit
5aa3da6495
|
@ -2455,9 +2455,10 @@ save(Picklerobject *self, PyObject *args, int pers_save)
|
||||||
goto finally;
|
goto finally;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((__reduce__ = PyDict_GetItem(dispatch_table, (PyObject *)type))) {
|
assert(t == NULL); /* just a reminder */
|
||||||
|
__reduce__ = PyDict_GetItem(dispatch_table, (PyObject *)type);
|
||||||
|
if (__reduce__ != NULL) {
|
||||||
Py_INCREF(__reduce__);
|
Py_INCREF(__reduce__);
|
||||||
|
|
||||||
Py_INCREF(args);
|
Py_INCREF(args);
|
||||||
ARG_TUP(self, args);
|
ARG_TUP(self, args);
|
||||||
if (self->arg) {
|
if (self->arg) {
|
||||||
|
@ -2467,16 +2468,14 @@ save(Picklerobject *self, PyObject *args, int pers_save)
|
||||||
if (! t) goto finally;
|
if (! t) goto finally;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
PyErr_Clear();
|
__reduce__ = PyObject_GetAttr(args, __reduce___str);
|
||||||
|
if (__reduce__ == NULL)
|
||||||
if ((__reduce__ = PyObject_GetAttr(args, __reduce___str))) {
|
PyErr_Clear();
|
||||||
|
else {
|
||||||
t = PyObject_Call(__reduce__, empty_tuple, NULL);
|
t = PyObject_Call(__reduce__, empty_tuple, NULL);
|
||||||
if (!t)
|
if (!t)
|
||||||
goto finally;
|
goto finally;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
PyErr_Clear();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (t) {
|
if (t) {
|
||||||
|
@ -2486,21 +2485,22 @@ save(Picklerobject *self, PyObject *args, int pers_save)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!PyTuple_Check(t)) {
|
if (!PyTuple_Check(t)) {
|
||||||
cPickle_ErrFormat(PicklingError, "Value returned by %s must "
|
cPickle_ErrFormat(PicklingError, "Value returned by "
|
||||||
"be a tuple", "O", __reduce__);
|
"%s must be a tuple",
|
||||||
|
"O", __reduce__);
|
||||||
goto finally;
|
goto finally;
|
||||||
}
|
}
|
||||||
|
|
||||||
size = PyTuple_Size(t);
|
size = PyTuple_Size(t);
|
||||||
|
|
||||||
if ((size != 3) && (size != 2)) {
|
if (size != 3 && size != 2) {
|
||||||
cPickle_ErrFormat(PicklingError, "tuple returned by %s must "
|
cPickle_ErrFormat(PicklingError, "tuple returned by "
|
||||||
"contain only two or three elements", "O", __reduce__);
|
"%s must contain only two or three elements",
|
||||||
|
"O", __reduce__);
|
||||||
goto finally;
|
goto finally;
|
||||||
}
|
}
|
||||||
|
|
||||||
callable = PyTuple_GET_ITEM(t, 0);
|
callable = PyTuple_GET_ITEM(t, 0);
|
||||||
|
|
||||||
arg_tup = PyTuple_GET_ITEM(t, 1);
|
arg_tup = PyTuple_GET_ITEM(t, 1);
|
||||||
|
|
||||||
if (size > 2) {
|
if (size > 2) {
|
||||||
|
@ -2510,8 +2510,9 @@ save(Picklerobject *self, PyObject *args, int pers_save)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!( PyTuple_Check(arg_tup) || arg_tup==Py_None )) {
|
if (!( PyTuple_Check(arg_tup) || arg_tup==Py_None )) {
|
||||||
cPickle_ErrFormat(PicklingError, "Second element of tuple "
|
cPickle_ErrFormat(PicklingError, "Second element of "
|
||||||
"returned by %s must be a tuple", "O", __reduce__);
|
"tuple returned by %s must be a tuple",
|
||||||
|
"O", __reduce__);
|
||||||
goto finally;
|
goto finally;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue