Commit df8cac1c authored by Rudi Chen's avatar Rudi Chen

CAPI exception case in converting long to double.

parent dd5cdc56
...@@ -928,6 +928,9 @@ template <ExceptionStyle S> static BoxedFloat* _floatNew(Box* a) noexcept(S == C ...@@ -928,6 +928,9 @@ template <ExceptionStyle S> static BoxedFloat* _floatNew(Box* a) noexcept(S == C
else else
throwCAPIException(); throwCAPIException();
} }
// Make sure that we're not in an error state when we return a non-NULL value.
assert(!PyErr_Occurred());
return new BoxedFloat(a_f); return new BoxedFloat(a_f);
} else if (a->cls == str_cls || a->cls == unicode_cls) { } else if (a->cls == str_cls || a->cls == unicode_cls) {
BoxedFloat* res = (BoxedFloat*)PyFloat_FromString(a, NULL); BoxedFloat* res = (BoxedFloat*)PyFloat_FromString(a, NULL);
......
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