summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2003-02-03 22:07:24 (GMT)
committerTim Peters <tim.peters@gmail.com>2003-02-03 22:07:24 (GMT)
commit0c7c48e02c8ea242a7e85f4668f2542de4dd3281 (patch)
treec1871c91dbb672ba49aa9542ae463ceb0ae4f285
parent61bf257633c44e25612ac3329c6ec9c1c47665f1 (diff)
downloadcpython-0c7c48e02c8ea242a7e85f4668f2542de4dd3281.zip
cpython-0c7c48e02c8ea242a7e85f4668f2542de4dd3281.tar.gz
cpython-0c7c48e02c8ea242a7e85f4668f2542de4dd3281.tar.bz2
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.
-rw-r--r--Modules/cPickle.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/Modules/cPickle.c b/Modules/cPickle.c
index 49e7271..10f65d6 100644
--- a/Modules/cPickle.c
+++ b/Modules/cPickle.c
@@ -360,20 +360,6 @@ static PyTypeObject Unpicklertype;
static int save(Picklerobject *, PyObject *, int);
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
PyObject *
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
* this.
*/
- PyErr_SetString(PyExc_ValueError, "LONG pickle has negative "
+ PyErr_SetString(UnpicklingError, "LONG pickle has negative "
"byte count");
return -1;
}