Mark Shannon <m...@hotpy.org> added the comment:

It is not `PyCode_Addr2Line()` that has changed, but `frame->f_lasti`.

If you call 
`PyCode_Addr2Line(frame->f_code, 8)` in 3.9

you get the same behavior as calling 

`PyCode_Addr2Line(frame->f_code, 8)` in 3.10.

Assuming the bytecode is unchanged.

The difference is that for the nth instruction `frame->f_lasti` is n*2 for 3.9 
and n for 3.10.

People should be using `PyFrame_GetLineNumber()`, which is part of the API.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44964>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to