From 7083bb744a552ab2bf31500763ace783d12f6fb8 Mon Sep 17 00:00:00 2001 From: Jeremy Hylton Date: Tue, 17 Feb 2004 20:10:11 +0000 Subject: [PATCH] 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. --- Objects/dictobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 35a3e31672b..eb0222cdd56 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; }