]> granicus.if.org Git - python/commitdiff
Only use PyCode_Addr2Line to get tb_lineno when Py_OptimizeFlag is set.
authorGuido van Rossum <guido@python.org>
Mon, 5 May 1997 20:53:25 +0000 (20:53 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 5 May 1997 20:53:25 +0000 (20:53 +0000)
Python/traceback.c

index 9633db15d96f49d1c53bdb23db1209c3acc64546..14e49052ee16bee9288005b34b4578bdd90412fd 100644 (file)
@@ -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),