diff --git a/interfaces/cython/cantera/thermo.pyx b/interfaces/cython/cantera/thermo.pyx index 9681a36ae85..1f8d76c55c8 100644 --- a/interfaces/cython/cantera/thermo.pyx +++ b/interfaces/cython/cantera/thermo.pyx @@ -19,6 +19,7 @@ cdef enum ThermoBasisType: molar_basis = 1 ctypedef CxxPlasmaPhase* CxxPlasmaPhasePtr +ctypedef CxxSurfPhase* CxxSurfPhasePtr class ThermoModelMethodError(Exception): """Exception raised for an invalid method used by a thermo model @@ -1874,7 +1875,7 @@ cdef class InterfacePhase(ThermoPhase): def __cinit__(self, *args, **kwargs): if not kwargs.get("init", True): return - if pystr(self.thermo.type()) not in ("Surf", "Edge"): + if not dynamic_cast[CxxSurfPhasePtr](self.thermo): raise TypeError('Underlying ThermoPhase object is of the wrong type.') self.surf = (self.thermo)