[Python-checkins] python/dist/src/Modules cPickle.c,2.132,2.133
tim_one@users.sourceforge.net
tim_one@users.sourceforge.net
Thu, 13 Feb 2003 13:04:02 -0800
Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv28537/Modules
Modified Files:
cPickle.c
Log Message:
save(): Reformat tail end just for clarity.
Index: cPickle.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/cPickle.c,v
retrieving revision 2.132
retrieving revision 2.133
diff -C2 -d -r2.132 -r2.133
*** cPickle.c 13 Feb 2003 18:24:14 -0000 2.132
--- cPickle.c 13 Feb 2003 21:03:57 -0000 2.133
***************
*** 2456,2462 ****
}
! if ((__reduce__ = PyDict_GetItem(dispatch_table, (PyObject *)type))) {
Py_INCREF(__reduce__);
-
Py_INCREF(args);
ARG_TUP(self, args);
--- 2456,2463 ----
}
! assert(t == NULL); /* just a reminder */
! __reduce__ = PyDict_GetItem(dispatch_table, (PyObject *)type);
! if (__reduce__ != NULL) {
Py_INCREF(__reduce__);
Py_INCREF(args);
ARG_TUP(self, args);
***************
*** 2468,2481 ****
}
else {
! PyErr_Clear();
!
! if ((__reduce__ = PyObject_GetAttr(args, __reduce___str))) {
t = PyObject_Call(__reduce__, empty_tuple, NULL);
if (!t)
goto finally;
}
- else {
- PyErr_Clear();
- }
}
--- 2469,2480 ----
}
else {
! __reduce__ = PyObject_GetAttr(args, __reduce___str);
! if (__reduce__ == NULL)
! PyErr_Clear();
! else {
t = PyObject_Call(__reduce__, empty_tuple, NULL);
if (!t)
goto finally;
}
}
***************
*** 2487,2492 ****
if (!PyTuple_Check(t)) {
! cPickle_ErrFormat(PicklingError, "Value returned by %s must "
! "be a tuple", "O", __reduce__);
goto finally;
}
--- 2486,2492 ----
if (!PyTuple_Check(t)) {
! cPickle_ErrFormat(PicklingError, "Value returned by "
! "%s must be a tuple",
! "O", __reduce__);
goto finally;
}
***************
*** 2494,2505 ****
size = PyTuple_Size(t);
! if ((size != 3) && (size != 2)) {
! cPickle_ErrFormat(PicklingError, "tuple returned by %s must "
! "contain only two or three elements", "O", __reduce__);
goto finally;
}
callable = PyTuple_GET_ITEM(t, 0);
-
arg_tup = PyTuple_GET_ITEM(t, 1);
--- 2494,2505 ----
size = PyTuple_Size(t);
! if (size != 3 && size != 2) {
! cPickle_ErrFormat(PicklingError, "tuple returned by "
! "%s must contain only two or three elements",
! "O", __reduce__);
goto finally;
}
callable = PyTuple_GET_ITEM(t, 0);
arg_tup = PyTuple_GET_ITEM(t, 1);
***************
*** 2511,2516 ****
if (!( PyTuple_Check(arg_tup) || arg_tup==Py_None )) {
! cPickle_ErrFormat(PicklingError, "Second element of tuple "
! "returned by %s must be a tuple", "O", __reduce__);
goto finally;
}
--- 2511,2517 ----
if (!( PyTuple_Check(arg_tup) || arg_tup==Py_None )) {
! cPickle_ErrFormat(PicklingError, "Second element of "
! "tuple returned by %s must be a tuple",
! "O", __reduce__);
goto finally;
}