mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
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
1 changed files with 1 additions and 1 deletions
|
@ -1256,7 +1256,7 @@ PyDict_Size(PyObject *mp)
|
||||||
{
|
{
|
||||||
if (mp == NULL || !PyDict_Check(mp)) {
|
if (mp == NULL || !PyDict_Check(mp)) {
|
||||||
PyErr_BadInternalCall();
|
PyErr_BadInternalCall();
|
||||||
return 0;
|
return -1;
|
||||||
}
|
}
|
||||||
return ((dictobject *)mp)->ma_used;
|
return ((dictobject *)mp)->ma_used;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue