Commit f7715b63 authored by Lars Buitinck's avatar Lars Buitinck

Catch a few arithmetic exceptions from C++ as well

parent b510608e
...@@ -8231,6 +8231,12 @@ static void __Pyx_CppExn2PyErr() { ...@@ -8231,6 +8231,12 @@ static void __Pyx_CppExn2PyErr() {
} catch (const std::out_of_range& exn) { } catch (const std::out_of_range& exn) {
// Change out_of_range to IndexError // Change out_of_range to IndexError
PyErr_SetString(PyExc_IndexError, exn.what()); PyErr_SetString(PyExc_IndexError, exn.what());
} catch (const std::overflow_error& exn) {
PyErr_SetString(PyExc_OverflowError, exn.what());
} catch (const std::range_error& exn) {
PyErr_SetString(PyExc_ArithmeticError, exn.what());
} catch (const std::underflow_error& exn) {
PyErr_SetString(PyExc_ArithmeticError, exn.what());
} catch (const std::exception& exn) { } catch (const std::exception& exn) {
PyErr_SetString(PyExc_RuntimeError, exn.what()); PyErr_SetString(PyExc_RuntimeError, exn.what());
} }
......
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