[issue42803] Traced line number is wrong for "if not __debug__"

Ned Batchelder report at bugs.python.org
Sat Jan 2 12:36:27 EST 2021


Ned Batchelder <ned at nedbatchelder.com> added the comment:

I think I am finding more examples of the same problem, so I will just add it here:

    x = "hello"
    try:
        3/0
    except ZeroDivisionError:
        if x == 'raise':
            raise ValueError()   # line 6
    f = 7

This shows a trace for line 6, which is never excecuted:

call <string> 1 @-1
    line <string> 1 @0
    line <string> 2 @4
    line <string> 3 @6
    exception <string> 3 @10
    line <string> 4 @24
    line <string> 5 @36
    line <string> 6 @50
    line <string> 7 @52
    return <string> 7 @58

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42803>
_______________________________________


More information about the Python-bugs-list mailing list