mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Issue #14815: Use Py_ssize_t instead of long for the object hash, to
preserve all 64 bits of hash on Win64.
This commit is contained in:
parent
1bc276d7ab
commit
49c15d4a5f
2 changed files with 5 additions and 2 deletions
|
|
@ -234,10 +234,10 @@ random_seed(RandomObject *self, PyObject *args)
|
|||
if (PyLong_Check(arg))
|
||||
n = PyNumber_Absolute(arg);
|
||||
else {
|
||||
long hash = PyObject_Hash(arg);
|
||||
Py_ssize_t hash = PyObject_Hash(arg);
|
||||
if (hash == -1)
|
||||
goto Done;
|
||||
n = PyLong_FromUnsignedLong((unsigned long)hash);
|
||||
n = PyLong_FromSsize_t(hash);
|
||||
}
|
||||
if (n == NULL)
|
||||
goto Done;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue