diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2004-02-17 20:10:11 +0000 |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2004-02-17 20:10:11 +0000 |
commit | f7aed14204f00d3202ae22c778076d90e4499348 (patch) | |
tree | 1e31c60742140759468e88532ddb8015d2c9d340 | |
parent | 16a395ef1e0e8f94191ac8e86b680888f746a02a (diff) | |
download | cpython-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.c | 2 |
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; } |