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.
G
Guido van Rossum committed
475296619309df6d437b6c6bdd33aea527e664cb
Parent: 2781fbe