Mercurial > cpython-lru_cache-weakref
diff Python/traceback.c @ 24844:cf5928fab108 legacy-trunk
This is my patch
[ 587993 ] SET_LINENO killer
Remove SET_LINENO. Tracing is now supported by inspecting co_lnotab.
Many sundry changes to document and adapt to this change.
| author | Michael W. Hudson <mwh@python.net> |
|---|---|
| date | Thu, 15 Aug 2002 14:59:02 +0000 |
| parents | 8291473fde3e |
| children | 808437b83b15 |
line wrap: on
line diff
--- a/Python/traceback.c Thu Aug 15 14:01:14 2002 +0000 +++ b/Python/traceback.c Thu Aug 15 14:59:02 2002 +0000 @@ -103,8 +103,7 @@ }; static tracebackobject * -newtracebackobject(tracebackobject *next, PyFrameObject *frame, int lasti, - int lineno) +newtracebackobject(tracebackobject *next, PyFrameObject *frame) { tracebackobject *tb; if ((next != NULL && !PyTraceBack_Check(next)) || @@ -118,8 +117,9 @@ tb->tb_next = next; Py_XINCREF(frame); tb->tb_frame = frame; - tb->tb_lasti = lasti; - tb->tb_lineno = lineno; + tb->tb_lasti = frame->f_lasti; + tb->tb_lineno = PyCode_Addr2Line(frame->f_code, + frame->f_lasti); PyObject_GC_Track(tb); } return tb; @@ -130,8 +130,7 @@ { PyThreadState *tstate = frame->f_tstate; tracebackobject *oldtb = (tracebackobject *) tstate->curexc_traceback; - tracebackobject *tb = newtracebackobject(oldtb, - frame, frame->f_lasti, frame->f_lineno); + tracebackobject *tb = newtracebackobject(oldtb, frame); if (tb == NULL) return -1; tstate->curexc_traceback = (PyObject *)tb;
