commit | ab2f8f7bd556c16a2b30aa8ec05d4c9d8c50d311 | [log] [tgz] |
---|---|---|
author | Martin v. Löwis <martin@v.loewis.de> | Wed Aug 09 07:57:39 2006 +0000 |
committer | Martin v. Löwis <martin@v.loewis.de> | Wed Aug 09 07:57:39 2006 +0000 |
tree | 173d0b8612bd7a76a7fc9c8105e8a53370dbd7ab | |
parent | 209307eb3bca9aeb9b842014edcfe8df9cbb7f91 [diff] [blame] |
__hash__ may now return long int; the final hash value is obtained by invoking hash on the long int. Fixes #1536021.
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 67e6104..652009b 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c
@@ -4559,7 +4559,10 @@ 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 {