Commit 00d83f2d authored by Alexandre Vassalotti's avatar Alexandre Vassalotti

Clean up error messages raised by save_reduce in _pickle.

parent 6eea8184
...@@ -2958,7 +2958,7 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj) ...@@ -2958,7 +2958,7 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj)
if (listitems == Py_None) if (listitems == Py_None)
listitems = NULL; listitems = NULL;
else if (!PyIter_Check(listitems)) { else if (!PyIter_Check(listitems)) {
PyErr_Format(PicklingError, "Fourth element of tuple" PyErr_Format(PicklingError, "fourth element of the tuple "
"returned by __reduce__ must be an iterator, not %s", "returned by __reduce__ must be an iterator, not %s",
Py_TYPE(listitems)->tp_name); Py_TYPE(listitems)->tp_name);
return -1; return -1;
...@@ -2967,7 +2967,7 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj) ...@@ -2967,7 +2967,7 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj)
if (dictitems == Py_None) if (dictitems == Py_None)
dictitems = NULL; dictitems = NULL;
else if (!PyIter_Check(dictitems)) { else if (!PyIter_Check(dictitems)) {
PyErr_Format(PicklingError, "Fifth element of tuple" PyErr_Format(PicklingError, "fifth element of the tuple "
"returned by __reduce__ must be an iterator, not %s", "returned by __reduce__ must be an iterator, not %s",
Py_TYPE(dictitems)->tp_name); Py_TYPE(dictitems)->tp_name);
return -1; return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment