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
1 changed files with 1 additions and 1 deletions

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