mirror of https://github.com/python/cpython
-1 is reserved for errors
This commit is contained in:
parent
e6baa46aab
commit
e7dfeeb889
|
@ -4959,6 +4959,9 @@ slot_tp_hash(PyObject *self)
|
||||||
PyErr_Clear();
|
PyErr_Clear();
|
||||||
h = PyLong_Type.tp_hash(res);
|
h = PyLong_Type.tp_hash(res);
|
||||||
}
|
}
|
||||||
|
/* -1 is reserved for errors. */
|
||||||
|
if (h == -1)
|
||||||
|
h = -2;
|
||||||
Py_DECREF(res);
|
Py_DECREF(res);
|
||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue