diff options
author | Guido van Rossum <guido@python.org> | 1997-05-05 20:53:25 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-05-05 20:53:25 +0000 |
commit | 088edf38f1523c75efee6d8f78ad1748f3ee176e (patch) | |
tree | 4253144924882c32604f325c9dc46571014effae /Python | |
parent | 877a5b370ced163448169c98881977fe5c8096b7 (diff) | |
download | cpython-088edf38f1523c75efee6d8f78ad1748f3ee176e.tar.gz |
Only use PyCode_Addr2Line to get tb_lineno when Py_OptimizeFlag is set.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/traceback.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/traceback.c b/Python/traceback.c index 9633db15d9..14e49052ee 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -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), |