Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

macros: raise AttributeError on property deletion requests #1779

Merged
merged 3 commits into from
Aug 14, 2021

Conversation

indygreg
Copy link
Contributor

The setter function will receive a NULL value on deletion requests.
This wasn't properly handled before, leading to a panic.

The new code raises AttributeError in this scenario instead.

A test for the behavior has been added. Documentation has also
been updated to reflect the behavior.

Closes #1775.

@mejrs
Copy link
Member

mejrs commented Aug 11, 2021

Looks like ci is failing because trybuild 1.0.44 was yanked, see dtolnay/trybuild#122 (comment)

Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

Thanks! Just some nits on the CHANGELOG, and probably will need to rebase once #1780 merged.

The setter function will receive a NULL value on deletion requests.
This wasn't properly handled before, leading to a panic.

The new code raises AttributeError in this scenario instead.

A test for the behavior has been added. Documentation has also
been updated to reflect the behavior.
Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

Looks great, thanks again!

@davidhewitt davidhewitt merged commit 584de68 into PyO3:main Aug 14, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic when calling del typ.attr on a [setter] defined attribute
3 participants