8000 gh-96663: Add a better error message for __dict__-less classes setattr by Gobot1234 · Pull Request #103232 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-96663: Add a better error message for __dict__-less classes setattr #103232

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

Merged
merged 11 commits into from
Jul 22, 2023
Prev Previous commit
Next Next commit
Remove the mention of __dict__ for del X().y when y doesn't exist
  • Loading branch information
Gobot1234 committed Apr 4, 2023
commit cac1d3358fb3037be1364e787bc5ea90468430a8
3 changes: 1 addition & 2 deletions Objects/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -1579,8 +1579,7 @@ _PyObject_GenericSetAttrWithDict(PyObject *obj, PyObject *name,
}
else {
PyErr_Format(PyExc_AttributeError,
"'%.100s' object has no attribute '%U' and no "
"__dict__ for setting new attributes",
"'%.100s' object has no attribute '%U'",
tp->tp_name, name);
}
set_attribute_error_context(obj, name);
Expand Down
0