gh-99677: Deduplicate self-type in mro in inspect._getmembers (#99678)

Closes #99677
This commit is contained in:
Nikita Sobolev 2022-11-27 14:15:26 +03:00 committed by GitHub
parent ac115b51e7
commit 2653b82c1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -537,7 +537,7 @@ def _getmembers(object, predicate, getter):
processed = set()
names = dir(object)
if isclass(object):
mro = (object,) + getmro(object)
mro = getmro(object)
# add any DynamicClassAttributes to the list of names if object is a class;
# this may result in duplicate entries if, for example, a virtual
# attribute with the same name as a DynamicClassAttribute exists