Message384178
(Using CPython commit 6b1ac809b9)
This program never executes line 4, but the "if not __debug__" is partly attributed to line 4, giving an incorrect trace:
for value in [True, False]:
if value:
if not __debug__:
1/0 # line 4
else:
x = 6
Using a simple trace program (https://github.com/nedbat/coveragepy/blob/master/lab/run_trace.py), it produces this output:
call <string> 1 @-1
line <string> 1 @0
line <string> 2 @8
line <string> 3 @12
line <string> 4 @14
line <string> 1 @4
line <string> 2 @8
line <string> 6 @16
line <string> 1 @4
return <string> 1 @24
Various simplifications of the program make the problem go away. |
|
Date |
User |
Action |
Args |
2021-01-01 14:43:03 | nedbat | set | recipients:
+ nedbat, Mark.Shannon |
2021-01-01 14:43:03 | nedbat | set | messageid: <1609512183.17.0.454209386156.issue42803@roundup.psfhosted.org> |
2021-01-01 14:43:03 | nedbat | link | issue42803 messages |
2021-01-01 14:43:03 | nedbat | create | |
|