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

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

Merged
merged 4 commits into from
Dec 4, 2020

Conversation

uriyyo
Copy link
Member

@uriyyo uriyyo commented Dec 3, 2020

@markshannon
Copy link
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
Member Author

uriyyo commented Dec 4, 2020

@markshannon I have updated test.

Should I also revert show_lineno = bool(linestarts)?

Copy link
Member

@markshannon markshannon left a comment

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.

Lib/test/test_dis.py Show resolved Hide resolved
@bedevere-bot
Copy link

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
Member Author

uriyyo commented Dec 4, 2020

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

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

@uriyyo
Copy link
Member Author

uriyyo commented Dec 4, 2020

Should we update PR title and News?

@markshannon
Copy link
Member

Should we update PR title and News?

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

@uriyyo uriyyo changed the title bpo-42562: Fix issue when dis failed to parse function that has only annotations bpo-42562: Fix issue when dis failed to parse function that has no line numbers Dec 4, 2020
@uriyyo
Copy link
Member Author

uriyyo commented Dec 4, 2020

I have updated PR title and News section.

@markshannon markshannon merged commit f24b810 into python:master Dec 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 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.

4 participants