8000 gh-102213: Optimize the performance of `__getattr__` by sunmy2019 · Pull Request #103761 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-102213: Optimize the performance of __getattr__ #103761

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 8 commits into from
May 1, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update Objects/typeobject.c
  • Loading branch information
sunmy2019 authored Apr 27, 2023
commit 75d9a70f8ce3c5b17e9797aee9b41d63a50e0a6d
3 changes: 2 additions & 1 deletion Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -8298,7 +8298,8 @@ _Py_slot_tp_getattr_hook(PyObject *self, PyObject *name)
((PyWrapperDescrObject *)getattribute)->d_wrapped ==
(void *)PyObject_GenericGetAttr)) {
res = _PyObject_GenericGetAttrWithDict(self, name, NULL, 1);
/* if no error has occurred, then it must be suppressed by us */
/* if res == NULL with no exception set, then it must be an
AttributeError suppressed by us. */
if (res == NULL && !PyErr_Occurred()) {
res = call_attribute(self, getattr, name);
}
Expand Down
0