Don't raise MemoryError in keys() when the database is empty.

This fixes SF bug #410146 (python 2.1b shelve is broken).
This commit is contained in:
Guido van Rossum 2001-03-22 00:19:22 +00:00
parent 24a4191160
commit ec24c1bc32
1 changed files with 1 additions and 1 deletions

View File

@ -427,7 +427,7 @@ bsddb_keys(bsddbobject *dp, PyObject *args)
if (data != NULL) memcpy(data,krec.data,krec.size);
}
BSDDB_END_SAVE(dp)
if (data==NULL) return PyErr_NoMemory();
if (status == 0 && data==NULL) return PyErr_NoMemory();
while (status == 0) {
if (dp->di_type == DB_RECNO)
item = PyInt_FromLong(*((int*)data));