Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e7dfeeb

Browse files
committed
-1 is reserved for errors
1 parent e6baa46 commit e7dfeeb

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Objects/typeobject.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4959,6 +4959,9 @@ slot_tp_hash(PyObject *self)
49594959
PyErr_Clear();
49604960
h = PyLong_Type.tp_hash(res);
49614961
}
4962+
/* -1 is reserved for errors. */
4963+
if (h == -1)
4964+
h = -2;
49624965
Py_DECREF(res);
49634966
return h;
49644967
}

0 commit comments

Comments
 (0)