Skip to content

Remove asserts that confuse enum _framestate with enum _frameowner - #124148

Merged
colesbury merged 3 commits into
python:mainfrom
andersk:frame-enum-confusion-2
Jan 2, 2025
Merged

Remove asserts that confuse enum _framestate with enum _frameowner#124148
colesbury merged 3 commits into
python:mainfrom
andersk:frame-enum-confusion-2

Conversation

@andersk

Copy link
Copy Markdown
Contributor

The owner field of _PyInterpreterFrame is supposed to be a member of enum _frameowner, but FRAME_CLEARED is a member of enum _framestate. At present, it happens that FRAME_CLEARED is not numerically equal to any member of enum _frameowner, but that could change in the future. The code that incorrectly assigned owner = FRAME_CLEARED was deleted in commit a53cc3f (GH-116687). Remove the incorrect checks for owner != FRAME_CLEARED as well.

The owner field of _PyInterpreterFrame is supposed to be a member of
enum _frameowner, but FRAME_CLEARED is a member of enum _framestate.
At present, it happens that FRAME_CLEARED is not numerically equal to
any member of enum _frameowner, but that could change in the future.
The code that incorrectly assigned owner = FRAME_CLEARED was deleted
in commit a53cc3f (pythonGH-116687).
Remove the incorrect checks for owner != FRAME_CLEARED as well.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>

@colesburycolesbury left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@brandtbucherbrandtbucher 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.

Yup, makes sense. Nice catch.

@colesburycolesbury added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Jan 2, 2025
@colesbury
colesbury enabled auto-merge (squash) January 2, 2025 16:33
@colesbury
colesbury merged commit a626f9a into python:mainJan 2, 2025
@miss-islington-app

Copy link
Copy Markdown

Thanks @andersk for the PR, and @colesbury for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @andersk and @colesbury, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker a626f9a67b76e5fe69677afd5f8317d8c61de8de 3.13

@miss-islington-app

Copy link
Copy Markdown

Sorry, @andersk and @colesbury, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker a626f9a67b76e5fe69677afd5f8317d8c61de8de 3.12

@colesbury

Copy link
Copy Markdown
Contributor

Backports didn't apply cleanly and we didn't backport #116687, so I figure it's probably not worth backporting this after all.

@colesburycolesbury removed needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Jan 2, 2025
@colesburycolesbury removed their assignment Jan 2, 2025
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
pythonGH-124148)
The `owner` field of `_PyInterpreterFrame` is supposed to be a member of
`enum _frameowner`, but `FRAME_CLEARED` is a member of `enum _framestate`.
At present, it happens that `FRAME_CLEARED` is not numerically equal to any
member of `enum _frameowner`, but that could change in the future. The code
that incorrectly assigned `owner = FRAME_CLEARED` was deleted in commit
a53cc3f (pythonGH-116687). Remove the incorrect
checks for `owner != FRAME_CLEARED` as well.
Sign up for freeto 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.

3 participants

@andersk@colesbury@brandtbucher