Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.10 fix co_lines parsing of co_linetable #160

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

2elli
Copy link
Collaborator

@2elli 2elli commented Jan 31, 2025

The parsing of co_linetable in 3.10 was still slightly broken, caught the issues with the new cross version tests. @jdw170000 found that the first linetable entry will have a line delta of 0, and was being skipped in some cases. This new algorithm follows the C code in 3.10 cpython instead of the example python snippet given.

@2elli 2elli marked this pull request as ready for review January 31, 2025 00:40
@rocky
Copy link
Owner

rocky commented Jan 31, 2025

I'll take your word for it, but I don't see how this code necessarily follows https://github.com/python/cpython/blob/3.10/Objects/codeobject.c#L1030 .

It looks like we want to follow PyLineTable_NextAddressRange and from that advance().

Also, it would be nice to have a test that shows the difference.

This can come as a future PR though.

@rocky rocky merged commit ba695e4 into rocky:master Jan 31, 2025
6 checks passed
@2elli
Copy link
Collaborator Author

2elli commented Jan 31, 2025

Yes ok makes sense, will do 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants