Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
eendebakpt committed Dec 23, 2022
1 parent 2c91bb4 commit fa39a8e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Include/internal/pycore_typeobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ extern void _PyStaticType_ClearWeakRefs(PyTypeObject *type);
extern void _PyStaticType_Dealloc(PyTypeObject *type);

PyObject *
_Py_type_getattro_impl(PyTypeObject *type, PyObject *name, int *flag);
_Py_type_getattro_impl(PyTypeObject *type, PyObject *name, int *supress);
PyObject *
_Py_type_getattro(PyTypeObject *type, PyObject *name);

Expand Down
6 changes: 3 additions & 3 deletions Objects/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -940,9 +940,9 @@ _PyObject_LookupAttr(PyObject *v, PyObject *name, PyObject **result)
return 0;
}
if (tp->tp_getattro == (getattrofunc)_Py_type_getattro) {
int flag = 0;
*result = _Py_type_getattro_impl((PyTypeObject*)v, name, &flag);
if (flag) {
int supress_missing_attribute_exception = 0;
*result = _Py_type_getattro_impl((PyTypeObject*)v, name, &supress_missing_attribute_exception);
if (supress_missing_attribute_exception) {
// return 0 without having to clear the exception
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -4811,7 +4811,7 @@ PyTypeObject PyType_Type = {
0, /* tp_hash */
(ternaryfunc)type_call, /* tp_call */
0, /* tp_str */
(getattrofunc)_Py_type_getattro, /* tp_getattro */
(getattrofunc)_Py_type_getattro, /* tp_getattro */
(setattrofunc)type_setattro, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
Expand Down

0 comments on commit fa39a8e

Please sign in to comment.