summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2004-02-17 20:10:11 +0000
committerJeremy Hylton <jeremy@alum.mit.edu>2004-02-17 20:10:11 +0000
commitf7aed14204f00d3202ae22c778076d90e4499348 (patch)
tree1e31c60742140759468e88532ddb8015d2c9d340
parent16a395ef1e0e8f94191ac8e86b680888f746a02a (diff)
downloadcpython-f7aed14204f00d3202ae22c778076d90e4499348.tar.gz
Oops. Return -1 to distinguish error from empty dict.
This change probably isn't work a bug fix. It's unlikely that anyone was calling this method without passing it a real dict.
-rw-r--r--Objects/dictobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 35a3e31672..eb0222cdd5 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -1256,7 +1256,7 @@ PyDict_Size(PyObject *mp)
{
if (mp == NULL || !PyDict_Check(mp)) {
PyErr_BadInternalCall();
- return 0;
+ return -1;
}
return ((dictobject *)mp)->ma_used;
}