diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-09-05 17:28:10 +0300 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-09-05 17:28:10 +0300 |
commit | 6db9e88effca95d6d48db243a05169b3ed79bc2d (patch) | |
tree | 898d65eb7459d06b012738206f3ec3d18163d413 /Lib/inspect.py | |
parent | 930c3c9e43dee8ad65f33d167b0c511cd22f6334 (diff) | |
download | cpython-git-6db9e88effca95d6d48db243a05169b3ed79bc2d.tar.gz |
Issue #18830: inspect.getclasstree() no more produces duplicated entries even
when input list contains duplicates.
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r-- | Lib/inspect.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py index c2a32fee24..933694394d 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -728,7 +728,8 @@ def getclasstree(classes, unique=0): 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) |