Message413984
Stefan,
f_lineno can be None for some opcodes, but there shouldn't be trace events if it is.
E.g.
>>> def f():
... try:
... 1/0
... finally:
... pass
...
>>> list(f.__code__.co_lines())
[(0, 2, 1), (2, 4, 2), (4, 12, 3), (12, 16, 5), (16, 18, None), (18, 26, 5)]
Note that the bytecode at offset 16 has no line number, but there should be no events for it.
BUT, before you try and fix your tracing emulation, I repeat my plea.
Please stop trying to mimic CPython internals, and ask for the APIs that you need. |
|
Date |
User |
Action |
Args |
2022-02-25 11:56:59 | Mark.Shannon | set | recipients:
+ Mark.Shannon, scoder, nedbat |
2022-02-25 11:56:59 | Mark.Shannon | set | messageid: <1645790219.18.0.781031936942.issue46389@roundup.psfhosted.org> |
2022-02-25 11:56:59 | Mark.Shannon | link | issue46389 messages |
2022-02-25 11:56:59 | Mark.Shannon | create | |
|