summaryrefslogtreecommitdiff
path: root/Modules/_randommodule.c
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2012-06-24 01:54:21 -0700
committerLarry Hastings <larry@hastings.org>2012-06-24 01:54:21 -0700
commit49c15d4a5fa139bf2d154112709a8b29c9d5d678 (patch)
tree1b6402adf739a7fbfabe6cd8ab24ed4e8b29529d /Modules/_randommodule.c
parent1bc276d7ab567ff5ef216a213e851e317b909529 (diff)
downloadcpython-git-49c15d4a5fa139bf2d154112709a8b29c9d5d678.tar.gz
Issue #14815: Use Py_ssize_t instead of long for the object hash, to
preserve all 64 bits of hash on Win64.
Diffstat (limited to 'Modules/_randommodule.c')
-rw-r--r--Modules/_randommodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c
index 3c7d70083a..52530e6154 100644
--- a/Modules/_randommodule.c
+++ b/Modules/_randommodule.c
@@ -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;