-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
bpo-42246: Partial implementation of PEP 626. #23113
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
Conversation
NOTE: |
I'd like to get this merged so I can finish implementing PEP 626. |
|
As part of python/cpython#23113 partly implementing PEP 626 (see https://bugs.python.org/issue42246), the co_lnotab member of struct PyCodeObject was replaced by co_linetable, implementing a new line number table. This commit therefore adds linetable to the list of attributes that are copied over into the final CodeType executed by fake_traceback() to ensure proper line numbers and contents in fake stack traces generated when running under Python 3.10. Fixes pallets#1333.
* Implement new line number table format, as defined in PEP 626.
addr = 0 | ||
for addr_incr, line_incr in zip(co_lnotab[::2], co_lnotab[1::2]): | ||
for addr_incr, line_incr in zip(co_linetable[::2], co_linetable[1::2]): | ||
if addr_incr == 255: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be if ord(addr_incr) == 255
This PR implements the bulk of PEP 626.
https://bugs.python.org/issue42246