Base: [skip ci] add method to more easily set the Python error indicator from a Base::Exception

This commit is contained in:
wmayer
2020-03-18 17:53:13 +01:00
parent bb4352c62d
commit 5bfef75696
5 changed files with 32 additions and 3 deletions

View File

@@ -146,6 +146,15 @@ void PyException::ReportException (void) const
}
}
void PyException::setPyException() const
{
std::stringstream str;
str << getStackTrace()
<< getErrorType()
<< ": " << what();
PyErr_SetString(getPyExceptionType(), str.str().c_str());
}
// ---------------------------------------------------------
SystemExitException::SystemExitException()