Skip to content

bpo-42562: Fix issue when dis failed to parse function that has no line numbers - #23632

Merged
markshannon merged 4 commits into
python:masterfrom
uriyyo:fix-issue-42562
Dec 4, 2020
Merged

bpo-42562: Fix issue when dis failed to parse function that has no line numbers#23632
markshannon merged 4 commits into
python:masterfrom
uriyyo:fix-issue-42562

Conversation

@uriyyo

@uriyyouriyyo commented Dec 3, 2020

Copy link
Copy Markdown
Member

@markshannon

Copy link
Copy Markdown
Member

#23636 will fix the missing line number.
dis shouldn't crash however, even if there is no line number.
Could you change the test to

def bug42562():
pass
bug42562.__code__ = bug42562.__code__.replace(co_linetable=b'\x04\x80\xff\x80')

to make the test robust against changes like #23636

@uriyyo

Copy link
Copy Markdown
MemberAuthor

@markshannon I have updated test.

Should I also revert show_lineno = bool(linestarts)?

@markshannonmarkshannon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a comment, otherwise LGTM.

Comment threadLib/test/test_dis.py
@bedevere-bot

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

And if you don't make the requested changes, you will be poked with soft cushions!

@uriyyo

Copy link
Copy Markdown
MemberAuthor

I have made the requested changes; please review again

@bedevere-bot

Copy link
Copy Markdown

Thanks for making the requested changes!

@markshannon: please review the changes made to this pull request.

@uriyyo

Copy link
Copy Markdown
MemberAuthor

Should we update PR title and News?

@markshannon

Copy link
Copy Markdown
Member

Should we update PR title and News?

Yes. Something like "has no line numbers" instead of "has only annotations"

@uriyyouriyyo changed the title bpo-42562: Fix issue when dis failed to parse function that has only annotationsbpo-42562: Fix issue when dis failed to parse function that has no line numbersDec 4, 2020
@uriyyo

Copy link
Copy Markdown
MemberAuthor

I have updated PR title and News section.

@markshannon
markshannon merged commit f24b810 into python:masterDec 4, 2020
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
…ne numbers (pythonGH-23632)
Fix issue when dis failed to parse function that has only annotations
Sign up for freeto 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.

4 participants

@uriyyo@markshannon@bedevere-bot@the-knights-who-say-ni