Commit 73481da6 authored by Jim Fulton's avatar Jim Fulton

Fixed ancient bug in handling special case of __setstate__ of a BTree

with no data.
parent 856f0a3d
......@@ -85,7 +85,7 @@
static char BTree_module_documentation[] =
""
"\n$Id: BTree.c,v 1.26 1999/08/05 13:32:34 jim Exp $"
"\n$Id: BTree.c,v 1.27 1999/08/19 23:39:01 jim Exp $"
;
#define PERSISTENT
......@@ -1786,9 +1786,18 @@ BTree_setstate(BTree *self, PyObject *args)
UNLESS(PyArg_ParseTuple(args,"O",&state)) return NULL;
if((l=PyTuple_Size(state))<0) return NULL;
PER_PREVENT_DEACTIVATION(self);
if (l==0)
{
if (_BTree_clear(self) < 0) return NULL;
PER_ALLOW_DEACTIVATION(self);
Py_INCREF(Py_None);
return Py_None;
}
if(l>self->size)
{
if(self->data)
......@@ -2102,7 +2111,7 @@ initBTree()
#endif
{
PyObject *m, *d;
char *rev="$Revision: 1.26 $";
char *rev="$Revision: 1.27 $";
......
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