diff --git a/interfaces/cython/cantera/_cantera.pxd b/interfaces/cython/cantera/_cantera.pxd index 78d83b15e..7d665ad0f 100644 --- a/interfaces/cython/cantera/_cantera.pxd +++ b/interfaces/cython/cantera/_cantera.pxd @@ -977,7 +977,7 @@ cdef class ReactionPathDiagram: cdef CxxStringStream* _log # free functions -cdef string stringify(x) +cdef string stringify(x) except * cdef pystr(string x) cdef np.ndarray get_species_array(Kinetics kin, kineticsMethod1d method) cdef np.ndarray get_reaction_array(Kinetics kin, kineticsMethod1d method) diff --git a/interfaces/cython/cantera/utils.pyx b/interfaces/cython/cantera/utils.pyx index 23b3788a3..906aa19c5 100644 --- a/interfaces/cython/cantera/utils.pyx +++ b/interfaces/cython/cantera/utils.pyx @@ -4,7 +4,7 @@ cdef int _pythonMajorVersion = sys.version_info[0] cdef CxxPythonLogger* _logger = new CxxPythonLogger() CxxSetLogger(_logger) -cdef string stringify(x): +cdef string stringify(x) except *: """ Converts Python strings to std::string. """ # This method works with both Python 2.x and 3.x. if isinstance(x, bytes):