mirror of https://github.com/python/cpython
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:
parent
24a4191160
commit
ec24c1bc32
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue