-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
bpo-25794: Fix type.__setattr__()
for non-interned attribute names.
#1652
bpo-25794: Fix type.__setattr__()
for non-interned attribute names.
#1652
Conversation
Based on patch by Eryk Sun.
@serhiy-storchaka, thanks for your PR! By analyzing the history of the files in this pull request, we identified @benjaminp, @tim-one and @larryhastings to be potential reviewers. |
Objects/typeobject.c
Outdated
return -1; | ||
} | ||
copied = 1; | ||
assert(PyUnicode_CheckExact(name)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need another call to PyUnicode_CheckExact
if PyUnicode_CheckExact(name)
in line 3142 returns true?
@@ -7090,6 +7115,9 @@ update_slot(PyTypeObject *type, PyObject *name) | |||
slotdef **pp; | |||
int offset; | |||
|
|||
assert(PyUnicode_CheckExact(name)); | |||
assert(PyUnicode_CHECK_INTERNED(name)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can now remove the following comment in line 7131:
/* XXX assume name is interned! */
…names. (pythonGH-1652) Based on patch by Eryk Sun.. (cherry picked from commit d896985)
…names. (pythonGH-1652) Based on patch by Eryk Sun.. (cherry picked from commit d896985)
Thank you for your review @berkerpeksag. |
…names. (pythonGH-1652) Based on patch by Eryk Sun.. (cherry picked from commit d896985)
Based on patch by Eryk Sun.