This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Mark.Shannon
Recipients Mark.Shannon, pablogsal
Date 2021-08-21.15:02:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1629558142.96.0.973379723433.issue44964@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-08-21 15:02:22Mark.Shannonsetrecipients: + Mark.Shannon, pablogsal
2021-08-21 15:02:22Mark.Shannonsetmessageid: <1629558142.96.0.973379723433.issue44964@roundup.psfhosted.org>
2021-08-21 15:02:22Mark.Shannonlinkissue44964 messages
2021-08-21 15:02:22Mark.Shannoncreate