Commit 4378ad13 authored by Marius Wachtler's avatar Marius Wachtler

Merge pull request #1137 from Daetalus/ref_nexedi_test_float

Fix test_math refcounting error
parents 81a372d9 a60b7d0e
# expected: reffail
import sys
import unittest
......@@ -369,7 +368,6 @@ class IntTestCases(IntLongCommonTests, unittest.TestCase):
def test_error_on_string_base(self):
self.assertRaises(TypeError, int, 100, base='foo')
@test_support.cpython_only
def test_small_ints(self):
self.assertIs(int('10'), 10)
self.assertIs(int('-1'), -1)
......
# expected: reffail
# Python test set -- math module
# XXXX Should not do tests around zero only
......
......@@ -163,7 +163,10 @@ extern "C" double PyFloat_AsDouble(PyObject* o) noexcept {
return -1;
}
return static_cast<BoxedFloat*>(fo)->d;
val = static_cast<BoxedFloat*>(fo)->d;
Py_DECREF(fo);
return val;
}
template <typename T> static inline void raiseDivZeroExcIfZero(T var) {
......
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