Skip to content

Commit 824d7cb

Browse files
author
Stefan Behnel
committed
Revert "Allow non-dict types for the class dict when looking up names and call PyObject_GetItem() for them."
This reverts commit 09e716a.
1 parent f09bfd3 commit 824d7cb

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Objects/typeobject.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2989,12 +2989,8 @@ find_name_in_mro(PyTypeObject *type, PyObject *name, int *error)
29892989
base = PyTuple_GET_ITEM(mro, i);
29902990
assert(PyType_Check(base));
29912991
dict = ((PyTypeObject *)base)->tp_dict;
2992-
assert(dict);
2993-
if (PyDict_CheckExact(dict)) {
2994-
res = _PyDict_GetItem_KnownHash(dict, name, hash);
2995-
} else {
2996-
res = PyObject_GetItem(dict, name);
2997-
}
2992+
assert(dict && PyDict_Check(dict));
2993+
res = _PyDict_GetItem_KnownHash(dict, name, hash);
29982994
if (res != NULL)
29992995
break;
30002996
if (PyErr_Occurred()) {

0 commit comments

Comments
 (0)