FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-100942: Fix crash on `property` subtypes with weird `__new__` by sobolevn · Pull Request #100955 · python/cpython · GitHub

/ cpython Public

gh-100942: Fix crash on property subtypes with weird __new__ - #100955

Closed
sobolevn wants to merge 3 commits into
python:mainfrom
sobolevn:issue-100942
Closed

gh-100942: Fix crash on property subtypes with weird __new__#100955
sobolevn wants to merge 3 commits into
python:mainfrom
sobolevn:issue-100942

Conversation

sobolevn commented Jan 11, 2023
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

I went with the easiest solution: just raise a TypeError in this case.
What are other options? 🤔

Copy link
Copy Markdown
Member Author

365556c is an alternative approach to 9bc9512

365556c does not raise, instead it uses this logic:

if (PyObject_TypeCheck(new, &PyProperty_Type)) {
        Py_XSETREF(((propertyobject *) new)->prop_name,
                   Py_XNewRef(pold->prop_name));
    }

sobolevn closed this Jan 12, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL