__hash__ may now return long int; the final hash

value is obtained by invoking hash on the long int.
Fixes #1536021.
This commit is contained in:
Martin v. Löwis 2006-08-09 07:57:39 +00:00
parent 209307eb3b
commit ab2f8f7bd5
5 changed files with 24 additions and 6 deletions

View file

@ -4559,7 +4559,10 @@ slot_tp_hash(PyObject *self)
Py_DECREF(func);
if (res == NULL)
return -1;
h = PyInt_AsLong(res);
if (PyLong_Check(res))
h = res->ob_type->tp_hash(res);
else
h = PyInt_AsLong(res);
Py_DECREF(res);
}
else {