Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c85b6a2

Browse files
author
Michael W. Hudson
committed
After the removal of SET_LINENO, PyCode_Addr2Line has always been
called to find tb_lineno -- even if Py_OptimizeFlag is true. So don't call it again when printing the traceback.
1 parent d9bb1a0 commit c85b6a2

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

Python/traceback.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,6 @@ tb_printinternal(tracebackobject *tb, PyObject *f, int limit)
238238
}
239239
while (tb != NULL && err == 0) {
240240
if (depth <= limit) {
241-
if (Py_OptimizeFlag)
242-
tb->tb_lineno = PyCode_Addr2Line(
243-
tb->tb_frame->f_code, tb->tb_lasti);
244241
err = tb_displayline(f,
245242
PyString_AsString(
246243
tb->tb_frame->f_code->co_filename),

0 commit comments

Comments
 (0)