]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-99677: Deduplicate self-type in `mro` in `inspect._getmembers` (#99678)
authorNikita Sobolev <mail@sobolevn.me>
Sun, 27 Nov 2022 11:15:26 +0000 (14:15 +0300)
committerGitHub <noreply@github.com>
Sun, 27 Nov 2022 11:15:26 +0000 (16:45 +0530)
Closes #99677

Lib/inspect.py

index a896fcda31d1dd238d834a5a941d35db2eb703c9..31ac888126b57c4c5dbe4bf03035ae2ccb58b15a 100644 (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