diff Python/traceback.c @ 5404:3780cce14f7d legacy-trunk

Only use PyCode_Addr2Line to get tb_lineno when Py_OptimizeFlag is set.
author Guido van Rossum <guido@python.org>
date Mon, 05 May 1997 20:53:25 +0000
parents 424922afc1bb
children b7871ca930ad
line wrap: on
line diff
--- a/Python/traceback.c	Mon May 05 20:48:00 1997 +0000
+++ b/Python/traceback.c	Mon May 05 20:53:25 1997 +0000
@@ -243,8 +243,9 @@
 	}
 	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),