From: Michael W. Hudson Date: Sat, 22 Feb 2003 13:07:53 +0000 (+0000) Subject: After the removal of SET_LINENO, PyCode_Addr2Line has always been X-Git-Tag: v2.3c1~1724 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c85b6a2d4d35d6ee0053a8f5870113512c1cdcb6;p=thirdparty%2FPython%2Fcpython.git After the removal of SET_LINENO, PyCode_Addr2Line has always been called to find tb_lineno -- even if Py_OptimizeFlag is true. So don't call it again when printing the traceback. --- diff --git a/Python/traceback.c b/Python/traceback.c index 27c69b68e5ea..b8edf139644d 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -238,9 +238,6 @@ tb_printinternal(tracebackobject *tb, PyObject *f, int limit) } while (tb != NULL && err == 0) { if (depth <= limit) { - if (Py_OptimizeFlag) - tb->tb_lineno = PyCode_Addr2Line( - tb->tb_frame->f_code, tb->tb_lasti); err = tb_displayline(f, PyString_AsString( tb->tb_frame->f_code->co_filename),