Commit 3c1fee54 authored by chris's avatar chris

rearranged memo check in save_tuple() to correct a small bug

parent b957e092
/*
$Id: cPickle.c,v 1.31 1997/03/04 21:07:59 jim Exp $
$Id: cPickle.c,v 1.32 1997/03/04 23:14:16 chris Exp $
Copyright
......@@ -912,25 +912,27 @@ save_tuple(Picklerobject *self, PyObject *args) {
UNLESS(py_tuple_id = PyInt_FromLong((long)args))
goto finally;
/* if ((has_key = len && PyMapping_HasKey(self->memo, py_tuple_id)) < 0) */
if ((has_key = PyMapping_HasKey(self->memo, py_tuple_id)) < 0)
goto finally;
if (len) {
if (has_key = PyMapping_HasKey(self->memo, py_tuple_id) < 0)
goto finally;
if (has_key) {
static char pop = POP;
if (has_key) {
static char pop = POP;
while (i-- > 0) {
if ((*self->write_func)(self, &pop, 1) < 0)
goto finally;
}
while (i-- > 0) {
if ((*self->write_func)(self, &pop, 1) < 0)
goto finally;
}
if (get(self, py_tuple_id) < 0)
goto finally;
if (get(self, py_tuple_id) < 0)
goto finally;
res = 0;
goto finally;
res = 0;
goto finally;
}
}
if ((*self->write_func)(self, &tuple, 1) < 0) {
goto finally;
}
......@@ -3714,7 +3716,7 @@ init_stuff(PyObject *module, PyObject *module_dict) {
void
initcPickle() {
PyObject *m, *d;
char *rev="$Revision: 1.31 $";
char *rev="$Revision: 1.32 $";
PyObject *format_version;
PyObject *compatible_formats;
......
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