From: Benjamin Peterson Date: Sun, 17 Oct 2010 21:27:01 +0000 (+0000) Subject: -1 is reserved for errors X-Git-Tag: v3.2a4~455 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e7dfeeb889ef1f19fc4c26bab843e913ee67e40d;p=thirdparty%2FPython%2Fcpython.git -1 is reserved for errors --- diff --git a/Objects/typeobject.c b/Objects/typeobject.c index a3905d84c709..2c1bf88db81f 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -4959,6 +4959,9 @@ slot_tp_hash(PyObject *self) PyErr_Clear(); h = PyLong_Type.tp_hash(res); } + /* -1 is reserved for errors. */ + if (h == -1) + h = -2; Py_DECREF(res); return h; }