Commit 0a6fd94d authored by Guido van Rossum's avatar Guido van Rossum

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

This fixes SF bug #410146 (python 2.1b shelve is broken).
parent 55c1babf
......@@ -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));
......
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