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.
This commit is contained in:
Jeremy Hylton 2004-02-17 20:10:11 +00:00
parent 9eb86b3c7c
commit 7083bb744a
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}