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

gh-118613: Fix error handling of _PyEval_GetFrameLocals in ceval.c #118614

Merged
merged 3 commits into from May 6, 2024

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented May 5, 2024

@gaogaotiantian
Copy link
Member

While you are on this matter, could you change the else if part to an assertion? The locals should either be a FrameLocalsProxy or a mapping at least. Just remove the else if case and change that to an assertion. Then you can always return locals at the end of the function.

Otherwise, logically, you need to handle the else case which should not ever exist.

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

Good to go!

@sobolevn sobolevn merged commit a8e5fed into python:main May 6, 2024
36 checks passed
@sobolevn sobolevn deleted the issue-118613 branch May 6, 2024 07:35
@sobolevn
Copy link
Member Author

sobolevn commented May 6, 2024

Since #115153 was not backported, I also don't backport.

Thanks everyone! 👍

@gaogaotiantian
Copy link
Member

This piece of code has only been in main for like 2 days so there's no need to backport :)

SonicField pushed a commit to SonicField/cpython that referenced this pull request May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants