Merge branch 'blender-v2.90-release' into master

This commit is contained in:
2020-08-06 15:48:42 +10:00
5 changed files with 31 additions and 0 deletions

View File

@@ -383,6 +383,20 @@ void PyC_StackSpit(void)
}
}
void PyC_StackPrint(FILE *fp)
{
PyThreadState *tstate = PyGILState_GetThisThreadState();
if (tstate != NULL && tstate->frame != NULL) {
PyFrameObject *frame = tstate->frame;
do {
const int line = PyCode_Addr2Line(frame->f_code, frame->f_lasti);
const char *filename = _PyUnicode_AsString(frame->f_code->co_filename);
const char *funcname = _PyUnicode_AsString(frame->f_code->co_name);
fprintf(fp, " File \"%s\", line %d in %s\n", filename, line, funcname);
} while ((frame = frame->f_back));
}
}
/** \} */
/* -------------------------------------------------------------------- */