summaryrefslogtreecommitdiffstats
path: root/Python/traceback.c
diff options
context:
space:
mode:
authorMichael W. Hudson <mwh@python.net>2002-08-15 14:59:02 (GMT)
committerMichael W. Hudson <mwh@python.net>2002-08-15 14:59:02 (GMT)
commitdd32a91cc0c8ba178d7ee5e78c30b6920aff66f4 (patch)
tree1a2062b54d3445ca788fd63c2bc63984dd85f34a /Python/traceback.c
parentadd88060c1d1a98c7970e35b326e6a65a17ddf04 (diff)
downloadcpython-dd32a91cc0c8ba178d7ee5e78c30b6920aff66f4.zip
cpython-dd32a91cc0c8ba178d7ee5e78c30b6920aff66f4.tar.gz
cpython-dd32a91cc0c8ba178d7ee5e78c30b6920aff66f4.tar.bz2
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.
Diffstat (limited to 'Python/traceback.c')
-rw-r--r--Python/traceback.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/Python/traceback.c b/Python/traceback.c
index de918f9..27c69b6 100644
--- a/Python/traceback.c
+++ b/Python/traceback.c
@@ -103,8 +103,7 @@ PyTypeObject PyTraceBack_Type = {
};
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 @@ newtracebackobject(tracebackobject *next, PyFrameObject *frame, int lasti,
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 @@ PyTraceBack_Here(PyFrameObject *frame)
{
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;