mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
-1 is reserved for errors
This commit is contained in:
parent
e6baa46aab
commit
e7dfeeb889
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue