Use Marc Lemburg's tb_lineno() to calculate the correct line number.
Apparently the traceback object doesn't contains the right linenumber when -O is used. Rather than guessing whether -O is on or off, use tb_lineno() unconditionally.
Showing
Please register or sign in to comment