summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-10-17 21:27:01 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-10-17 21:27:01 (GMT)
commite7dfeeb889ef1f19fc4c26bab843e913ee67e40d (patch)
tree53f498269abeb1e53ccb046f15372f0aaf5c431e
parente6baa46aab0e37c755c94b5aa513fff43fd57456 (diff)
downloadcpython-e7dfeeb889ef1f19fc4c26bab843e913ee67e40d.zip
cpython-e7dfeeb889ef1f19fc4c26bab843e913ee67e40d.tar.gz
cpython-e7dfeeb889ef1f19fc4c26bab843e913ee67e40d.tar.bz2
-1 is reserved for errors
-rw-r--r--Objects/typeobject.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index a3905d8..2c1bf88 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;
}