Skip to content

Commit

Permalink
Restore refactor lost in merge
Browse files Browse the repository at this point in the history
Use descriptor_is_class
  • Loading branch information
mpage committed Jan 2, 2025
1 parent f1fdcc6 commit 8b71951
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Python/specialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -942,10 +942,8 @@ analyze_descriptor_load(PyTypeObject *type, PyObject *name, PyObject **descr, un
PyObject *descriptor = _PyType_LookupRefAndVersion(type, name, &descr_version);
*descr = descriptor;
*tp_version = have_ga_version ? ga_version : descr_version;
if (PyUnicode_CompareWithASCIIString(name, "__class__") == 0) {
if (descriptor == _PyType_Lookup(&PyBaseObject_Type, name)) {
return DUNDER_CLASS;
}
if (descriptor_is_class(descriptor, name)) {
return DUNDER_CLASS;
}
return classify_descriptor(descriptor, has_getattr);
}
Expand Down

0 comments on commit 8b71951

Please sign in to comment.