mirror of https://github.com/python/cpython
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:
parent
9eb86b3c7c
commit
7083bb744a
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue