Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix test failure on Python 3.12 (fixes osandov#298)
Running tests on Python 3.12, we get: test_int (tests.test_language_c.TestLiteral.test_int) ... python3.12: /usr/include/python3.12/object.h:215: Py_SIZE: Assertion `ob->ob_type != &PyLong_Type' failed. Aborted (core dumped) We're relying on an implementation detail to check whether the object is negative. Instead, catch an overflow error, negate and try again. Genuine overflows will still overflow on the second time, but negative numbers will succeed. Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com>
- Loading branch information