Base: set sys.last_vars to enable post mortem debugging after exception
* Update Interpreter.cpp to enable stack trace This enables python debuggers to stack trace after an exception. See https://forum.freecad.org/viewtopic.php?p=714349#p714349 Co-authored-by: bdieterm <119257544+bdieterm@users.noreply.github.com>
This commit is contained in:
@@ -125,6 +125,8 @@ void PyException::ReportException () const
|
||||
{
|
||||
if (!_isReported) {
|
||||
_isReported = true;
|
||||
// set sys.last_vars to make post-mortem debugging work
|
||||
PySys_SetObject("last_traceback", PP_last_traceback);
|
||||
Base::Console().DeveloperError("pyException","%s%s: %s\n",
|
||||
_stackTrace.c_str(), _errorType.c_str(), what());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user