summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Objects/abstract.c2
-rw-r--r--Objects/object.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index b47b1c9..de8682a 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -123,7 +123,7 @@ _PyObject_LengthHint(PyObject *o, Py_ssize_t defaultvalue)
PyErr_Clear();
return defaultvalue;
}
- rv = rv = PyLong_Check(ro) ? PyLong_AsSsize_t(ro) : defaultvalue;
+ rv = PyLong_Check(ro) ? PyLong_AsSsize_t(ro) : defaultvalue;
Py_DECREF(ro);
return rv;
}
diff --git a/Objects/object.c b/Objects/object.c
index 7b82db9..daee6fb 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1023,7 +1023,7 @@ _Py_HashDouble(double v)
fractpart = modf(v, &intpart);
if (fractpart == 0.0) {
/* This must return the same hash as an equal int or long. */
- if (intpart > LONG_MAX || -intpart > LONG_MAX) {
+ if (intpart > LONG_MAX/2 || -intpart > LONG_MAX/2) {
/* Convert to long and use its hash. */
PyObject *plong; /* converted to Python long */
if (Py_IS_INFINITY(intpart))