mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #18830: inspect.getclasstree() no more produces duplicated entries even
when input list contains duplicates.
This commit is contained in:
parent
e1040e276b
commit
362c1b513d
4 changed files with 26 additions and 3 deletions
|
@ -753,7 +753,8 @@ def getclasstree(classes, unique=False):
|
|||
for parent in c.__bases__:
|
||||
if not parent in children:
|
||||
children[parent] = []
|
||||
children[parent].append(c)
|
||||
if c not in children[parent]:
|
||||
children[parent].append(c)
|
||||
if unique and parent in classes: break
|
||||
elif c not in roots:
|
||||
roots.append(c)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue