diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2004-02-17 20:10:11 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2004-02-17 20:10:11 (GMT) |
commit | 7083bb744a552ab2bf31500763ace783d12f6fb8 (patch) | |
tree | 40675661a1875cd1f3658e28dc35471084ccf6c9 /Objects | |
parent | 9eb86b3c7cd44831735392f67ae3d97f859271ba (diff) | |
download | cpython-7083bb744a552ab2bf31500763ace783d12f6fb8.zip cpython-7083bb744a552ab2bf31500763ace783d12f6fb8.tar.gz cpython-7083bb744a552ab2bf31500763ace783d12f6fb8.tar.bz2 |
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.
Diffstat (limited to 'Objects')
-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 35a3e31..eb0222c 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; } |