From: Jeremy Hylton Date: Tue, 17 Feb 2004 20:10:11 +0000 (+0000) Subject: Oops. Return -1 to distinguish error from empty dict. X-Git-Tag: v2.4a1~804 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7083bb744a552ab2bf31500763ace783d12f6fb8;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 35a3e31672b6..eb0222cdd56d 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; }