while (ptb != NULL) {
PyFrameObject *cur_frame = ptb->tb_frame;
+#if PY_VERSION_HEX >= 0x030A0000
+ PyCodeObject *code = PyFrame_GetCode(cur_frame);
+#endif
ROPTIONAL(RERROR, ERROR, "[%ld] %s:%d at %s()",
fnum,
+#if PY_VERSION_HEX >= 0x030A0000
+ PyUnicode_AsUTF8(code->co_filename),
+#else
PyUnicode_AsUTF8(cur_frame->f_code->co_filename),
+#endif
PyFrame_GetLineNumber(cur_frame),
+#if PY_VERSION_HEX >= 0x30A0000
+ PyUnicode_AsUTF8(code->co_name)
+#else
PyUnicode_AsUTF8(cur_frame->f_code->co_name)
+#endif
);
+#if PY_VERSION_HEX >= 0x030A0000
+ Py_XDECREF(code);
+#endif
ptb = ptb->tb_next;
fnum++;