Commit 529c888f authored by Boxiang Sun's avatar Boxiang Sun

copy PyNumber_Coerce from CPython

parent 9966b57b
......@@ -1865,8 +1865,11 @@ extern "C" PyObject* PyNumber_InPlaceOr(PyObject*, PyObject*) noexcept {
return nullptr;
}
extern "C" int PyNumber_Coerce(PyObject**, PyObject**) noexcept {
fatalOrError(PyExc_NotImplementedError, "unimplemented");
extern "C" int PyNumber_Coerce(PyObject** pv, PyObject** pw) noexcept {
int err = PyNumber_CoerceEx(pv, pw);
if (err <= 0)
return err;
PyErr_SetString(PyExc_TypeError, "number coercion failed");
return -1;
}
......
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