mirror of
https://github.com/python/cpython.git
synced 2025-11-03 11:23:31 +00:00
load_counted_long(): Changed a ValueError to an UnpicklingError, just
because it seems more consistent with the rest of the code. cPickle_PyMapping_HasKey(): This extern function isn't used anywhere in Python or Zope, so got rid of it.
This commit is contained in:
parent
61bf257633
commit
0c7c48e02c
1 changed files with 1 additions and 15 deletions
|
|
@ -360,20 +360,6 @@ static PyTypeObject Unpicklertype;
|
||||||
static int save(Picklerobject *, PyObject *, int);
|
static int save(Picklerobject *, PyObject *, int);
|
||||||
static int put2(Picklerobject *, PyObject *);
|
static int put2(Picklerobject *, PyObject *);
|
||||||
|
|
||||||
int
|
|
||||||
cPickle_PyMapping_HasKey(PyObject *o, PyObject *key)
|
|
||||||
{
|
|
||||||
PyObject *v;
|
|
||||||
|
|
||||||
if ((v = PyObject_GetItem(o,key))) {
|
|
||||||
Py_DECREF(v);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
PyErr_Clear();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static
|
static
|
||||||
PyObject *
|
PyObject *
|
||||||
cPickle_ErrFormat(PyObject *ErrType, char *stringformat, char *format, ...)
|
cPickle_ErrFormat(PyObject *ErrType, char *stringformat, char *format, ...)
|
||||||
|
|
@ -3022,7 +3008,7 @@ load_counted_long(Unpicklerobject *self, int size)
|
||||||
/* Corrupt or hostile pickle -- we never write one like
|
/* Corrupt or hostile pickle -- we never write one like
|
||||||
* this.
|
* this.
|
||||||
*/
|
*/
|
||||||
PyErr_SetString(PyExc_ValueError, "LONG pickle has negative "
|
PyErr_SetString(UnpicklingError, "LONG pickle has negative "
|
||||||
"byte count");
|
"byte count");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue