Skip to content

Propagate non-AttributeError exceptions in PyUpb_MessageMeta_GetAttr#28206

Draft
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_938309285
Draft

Propagate non-AttributeError exceptions in PyUpb_MessageMeta_GetAttr#28206
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_938309285

Conversation

@copybara-service

Copy link
Copy Markdown

Propagate non-AttributeError exceptions in PyUpb_MessageMeta_GetAttr

When cpython_bits.type_getattro(self, name) returns NULL due to an exception raised in a descriptor (such as KeyboardInterrupt, MemoryError, or SystemExit), PyUpb_MessageMeta_GetAttr previously cleared the error and raised AttributeError.

Check PyErr_ExceptionMatches(PyExc_AttributeError) before clearing the error to ensure non-AttributeError exceptions are properly propagated.

When cpython_bits.type_getattro(self, name) returns NULL due to an exception raised in a descriptor (such as KeyboardInterrupt, MemoryError, or SystemExit), PyUpb_MessageMeta_GetAttr previously cleared the error and raised AttributeError.

Check PyErr_ExceptionMatches(PyExc_AttributeError) before clearing the error to ensure non-AttributeError exceptions are properly propagated.

PiperOrigin-RevId: 938309285
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.

1 participant