diff options
Diffstat (limited to 'Python/traceback.c')
-rw-r--r-- | Python/traceback.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/traceback.c b/Python/traceback.c index 664a73f..722f007 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -115,7 +115,10 @@ static int tb_get_lineno(PyTracebackObject* tb) { PyFrameObject* frame = tb->tb_frame; assert(frame != NULL); - return PyCode_Addr2Line(PyFrame_GetCode(frame), tb->tb_lasti); + PyCodeObject *code = PyFrame_GetCode(frame); + int lineno = PyCode_Addr2Line(code, tb->tb_lasti); + Py_DECREF(code); + return lineno; } static PyObject * |