summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/traceback.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/traceback.c b/Python/traceback.c
index 9633db1..14e4905 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),