Commit 815129b1 authored by Marius Wachtler's avatar Marius Wachtler

Merge pull request #1136 from Daetalus/ref_nexedi_test_long

add refcounting annotation that make test_long pass
parents cc2add2a f73778fa
# expected: reffail
import unittest
import sys
......
......@@ -1575,7 +1575,6 @@ Box* instanceInt(Box* _inst) {
}
Box* truncated = instanceTrunc(inst);
AUTO_DECREF(truncated);
/* __trunc__ is specified to return an Integral type, but
int() needs to return an int. */
Box* res = _PyNumber_ConvertIntegralToInt(truncated, "__trunc__ returned non-Integral (type %.200s)");
......
......@@ -712,11 +712,11 @@ template <ExceptionStyle S> Box* _longNew(Box* val, Box* _base) noexcept(S == CA
Box* srepr = PyObject_Repr(val);
if (S == CAPI) {
PyErr_Format(PyExc_ValueError, "invalid literal for long() with base %d: '%s'", base,
PyString_AS_STRING(srepr));
PyString_AS_STRING(autoDecref(srepr)));
return NULL;
} else {
raiseExcHelper(ValueError, "invalid literal for long() with base %d: '%s'", base,
PyString_AS_STRING(srepr));
PyString_AS_STRING(autoDecref(srepr)));
}
}
Box* r = PyLong_FromString(s->data(), NULL, base);
......
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