From ef6a482b0285870c45f39c9b17ed827362b334ae Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Thu, 7 Apr 2022 12:31:01 -0700 Subject: bpo-47177: Replace `f_lasti` with `prev_instr` (GH-32208) --- Python/frame.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Python/frame.c') diff --git a/Python/frame.c b/Python/frame.c index 3396ed8d2a..c2da123a2b 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); +} -- cgit v1.2.1