diff options
| author | Guido van Rossum <guido@python.org> | 1997-01-24 04:02:55 +0000 |
|---|---|---|
| committer | Guido van Rossum <guido@python.org> | 1997-01-24 04:02:55 +0000 |
| commit | c9f5f0ade1a1e45939c6d6124247aea870e01bc6 (patch) | |
| tree | 4294b45b0186324ae47c2b4c5eb8aeede194df05 /Python | |
| parent | 325a1f6577cb91b98875e66f8fdb563edf55996e (diff) | |
| download | cpython-c9f5f0ade1a1e45939c6d6124247aea870e01bc6.tar.gz | |
Get the line number from PyCode_Addr2Line instead of believing
tb_lineno. Store it in tb_lineno for the user.
Diffstat (limited to 'Python')
| -rw-r--r-- | Python/traceback.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/traceback.c b/Python/traceback.c index b06a74286b..3f80ef5e56 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -243,11 +243,14 @@ tb_printinternal(tb, f, limit) tb1 = tb1->tb_next; } 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, getstringvalue(tb->tb_frame->f_code->co_filename), tb->tb_lineno, getstringvalue(tb->tb_frame->f_code->co_name)); + } depth--; tb = tb->tb_next; } |
