[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:
parent
9bba45b01e
commit
9c368d57b3
1 changed files with 1 additions and 1 deletions
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue