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:
Ed Williams
2023-10-30 22:40:57 -10:00
committed by GitHub
parent a1ecc2b543
commit 792af641db

View File

@@ -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());
}