Kaydet (Commit) b3f515af authored tarafından Guido van Rossum's avatar Guido van Rossum

Get the line number from PyCode_Addr2Line instead of believing

tb_lineno.  Store it in tb_lineno for the user.
üst 747596a4
...@@ -243,11 +243,14 @@ tb_printinternal(tb, f, limit) ...@@ -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;
} }
......
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