summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/_warnings.c2
-rw-r--r--Python/ceval.c2
-rw-r--r--Python/traceback.c3
3 files changed, 3 insertions, 4 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c
index 1a7c2d51e6..219cfc6ee1 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -454,7 +454,7 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno,
}
else {
globals = f->f_globals;
- *lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
+ *lineno = PyFrame_GetLineNumber(f);
}
*module = NULL;
diff --git a/Python/ceval.c b/Python/ceval.c
index 88b9d0e888..474a8851db 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2698,7 +2698,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
default:
fprintf(stderr,
"XXX lineno: %d, opcode: %d\n",
- PyCode_Addr2Line(f->f_code, f->f_lasti),
+ PyFrame_GetLineNumber(f),
opcode);
PyErr_SetString(PyExc_SystemError, "unknown opcode");
why = WHY_EXCEPTION;
diff --git a/Python/traceback.c b/Python/traceback.c
index c2d7e77a3e..1c26ba271a 100644
--- a/Python/traceback.c
+++ b/Python/traceback.c
@@ -96,8 +96,7 @@ newtracebackobject(PyTracebackObject *next, PyFrameObject *frame)
Py_XINCREF(frame);
tb->tb_frame = frame;
tb->tb_lasti = frame->f_lasti;
- tb->tb_lineno = PyCode_Addr2Line(frame->f_code,
- frame->f_lasti);
+ tb->tb_lineno = PyFrame_GetLineNumber(frame);
PyObject_GC_Track(tb);
}
return tb;