diff options
| author | Guido van Rossum <guido@python.org> | 2001-03-22 00:19:22 +0000 |
|---|---|---|
| committer | Guido van Rossum <guido@python.org> | 2001-03-22 00:19:22 +0000 |
| commit | 0a6fd94de2623ae2c0201f4ee4825350f8542d00 (patch) | |
| tree | 1c5e56b74876fcf902335da1c3e93f296f161163 /Modules/bsddbmodule.c | |
| parent | 55c1babf60b6b2601585f87aeaaf82cbbdfa0e0c (diff) | |
| download | cpython-0a6fd94de2623ae2c0201f4ee4825350f8542d00.tar.gz | |
Don't raise MemoryError in keys() when the database is empty.
This fixes SF bug #410146 (python 2.1b shelve is broken).
Diffstat (limited to 'Modules/bsddbmodule.c')
| -rw-r--r-- | Modules/bsddbmodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/bsddbmodule.c b/Modules/bsddbmodule.c index ecfb653d8e..be50208b63 100644 --- a/Modules/bsddbmodule.c +++ b/Modules/bsddbmodule.c @@ -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)); |
