We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 881c9eb commit 4b0c875Copy full SHA for 4b0c875
Python/traceback.c
@@ -111,7 +111,10 @@ static int
111
tb_get_lineno(PyTracebackObject* tb) {
112
PyFrameObject* frame = tb->tb_frame;
113
assert(frame != NULL);
114
- return PyCode_Addr2Line(PyFrame_GetCode(frame), tb->tb_lasti);
+ PyCodeObject *code = PyFrame_GetCode(frame);
115
+ int lineno = PyCode_Addr2Line(code, tb->tb_lasti);
116
+ Py_DECREF(code);
117
+ return lineno;
118
}
119
120
static PyObject *
0 commit comments