From 9c368d57b3615f40935afbb7fa3850aab2a2abee Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Sun, 9 Oct 2016 17:58:44 -0400 Subject: [PATCH] [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. --- include/cantera/cython/funcWrapper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/cantera/cython/funcWrapper.h b/include/cantera/cython/funcWrapper.h index 804b2d80e..23449efde 100644 --- a/include/cantera/cython/funcWrapper.h +++ b/include/cantera/cython/funcWrapper.h @@ -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"); }