Commit fe443dd6 authored by Tres Seaver's avatar Tres Seaver

(Attempt to) fix Overflow in tests on Win64.

See: https://github.com/zopefoundation/BTrees/issues/32.
parent 96e88e11
......@@ -84,14 +84,24 @@ longlong_check(PyObject *ob)
return 1;
if (PyLong_Check(ob)) {
#if PY_VERSION_HEX < 0x02070000
/* check magnitude */
PY_LONG_LONG val = PyLong_AsLongLong(ob);
if (val == -1 && PyErr_Occurred())
return 0;
goto overflow;
#else
int overflow;
(void)PyLong_AsLongLongAndOverflow(ob, &overflow);
if (overflow)
goto overflow;
#endif
return 1;
}
return 0;
overflow:
PyErr_SetString(PyExc_ValueError, "long integer out of range");
return 0;
}
static PyObject *
......
......@@ -4,6 +4,10 @@
4.3.0 (TBD)
-----------
- Fix unexpected ``OverflowError`` when passing 64bit values to long
keys / values on Win64. See:
https://github.com/zopefoundation/BTrees/issues/32
- When testing ``PURE_PYTHON`` environments under ``tox``, avoid poisoning
the user's global wheel cache.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment