From 8ca5e0d8c9a79c6a09b0581cae603f0b4ede47d9 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Tue, 22 Nov 2022 12:00:34 +0300 Subject: [PATCH] gh-99677: Deduplicate self-type in `mro` in `inspect._getmembers` --- Lib/inspect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/inspect.py b/Lib/inspect.py index d0015aa202044e..bb44722b6837d9 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -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