aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/frame.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/frame.c')
-rw-r--r--Python/frame.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/frame.c b/Python/frame.c
index 3396ed8d2ae..c2da123a2bb 100644
--- a/Python/frame.c
+++ b/Python/frame.c
@@ -127,3 +127,10 @@ _PyFrame_Push(PyThreadState *tstate, PyFunctionObject *func)
_PyFrame_InitializeSpecials(new_frame, func, NULL, code->co_nlocalsplus);
return new_frame;
}
+
+int
+_PyInterpreterFrame_GetLine(_PyInterpreterFrame *frame)
+{
+ int addr = _PyInterpreterFrame_LASTI(frame) * sizeof(_Py_CODEUNIT);
+ return PyCode_Addr2Line(frame->f_code, addr);
+}