summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-03-22 00:19:22 (GMT)
committerGuido van Rossum <guido@python.org>2001-03-22 00:19:22 (GMT)
commitec24c1bc32d06a8c9af5cacfbbca28e6175d6ed4 (patch)
treecbaedfe2d2caf413d11903d3dde1d4b22cab9dbc /Modules
parent24a41911602bf98e853278ef4bb8b4fb41c0ac8c (diff)
downloadcpython-ec24c1bc32d06a8c9af5cacfbbca28e6175d6ed4.zip
cpython-ec24c1bc32d06a8c9af5cacfbbca28e6175d6ed4.tar.gz
cpython-ec24c1bc32d06a8c9af5cacfbbca28e6175d6ed4.tar.bz2
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')
-rw-r--r--Modules/bsddbmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/bsddbmodule.c b/Modules/bsddbmodule.c
index ecfb653..be50208 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));