mirror of https://github.com/python/cpython
Get the line number from PyCode_Addr2Line instead of believing
tb_lineno. Store it in tb_lineno for the user.
This commit is contained in:
parent
747596a491
commit
b3f515af64
|
@ -243,11 +243,14 @@ tb_printinternal(tb, f, limit)
|
||||||
tb1 = tb1->tb_next;
|
tb1 = tb1->tb_next;
|
||||||
}
|
}
|
||||||
while (tb != NULL && !intrcheck()) {
|
while (tb != NULL && !intrcheck()) {
|
||||||
if (depth <= limit)
|
if (depth <= limit) {
|
||||||
|
tb->tb_lineno = PyCode_Addr2Line(tb->tb_frame->f_code,
|
||||||
|
tb->tb_lasti);
|
||||||
tb_displayline(f,
|
tb_displayline(f,
|
||||||
getstringvalue(tb->tb_frame->f_code->co_filename),
|
getstringvalue(tb->tb_frame->f_code->co_filename),
|
||||||
tb->tb_lineno,
|
tb->tb_lineno,
|
||||||
getstringvalue(tb->tb_frame->f_code->co_name));
|
getstringvalue(tb->tb_frame->f_code->co_name));
|
||||||
|
}
|
||||||
depth--;
|
depth--;
|
||||||
tb = tb->tb_next;
|
tb = tb->tb_next;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue