Commit 088edf38 authored by Guido van Rossum's avatar Guido van Rossum

Only use PyCode_Addr2Line to get tb_lineno when Py_OptimizeFlag is set.

parent 877a5b37
......@@ -243,8 +243,9 @@ tb_printinternal(tb, f, limit)
}
while (tb != NULL && !PyOS_InterruptOccurred()) {
if (depth <= limit) {
tb->tb_lineno = PyCode_Addr2Line(tb->tb_frame->f_code,
tb->tb_lasti);
if (Py_OptimizeFlag)
tb->tb_lineno = PyCode_Addr2Line(
tb->tb_frame->f_code, tb->tb_lasti);
tb_displayline(f,
PyString_AsString(
tb->tb_frame->f_code->co_filename),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment