[Cython] translate_exception should raise RuntimeError

This is more consistent with the behavior of Cython for other exception types,
where unknown types of std::exception are translated to Python RuntimeError
exceptions.
This commit is contained in:
Ray Speth 2016-10-09 17:58:44 -04:00
parent 9bba45b01e
commit 9c368d57b3

View file

@ -103,7 +103,7 @@ inline int translate_exception()
} catch (const std::out_of_range& exn) {
PyErr_SetString(PyExc_IndexError, exn.what());
} catch (const std::exception& exn) {
PyErr_SetString(PyExc_Exception, exn.what());
PyErr_SetString(PyExc_RuntimeError, exn.what());
} catch (...) {
PyErr_SetString(PyExc_Exception, "Unknown exception");
}