diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2013-09-05 17:16:12 +0300 |
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-09-05 17:16:12 +0300 |
| commit | 1e0d82cece755018a022acd5d1f7c0eb890e03db (patch) | |
| tree | 733d3c3601f15ecd9020cb41c6dfec2620d5a595 /Lib/inspect.py | |
| parent | 34d201374ce4bb2c693565ba5fa0c3aa94b490ad (diff) | |
| parent | 362c1b513d5b7354f50dd2371d178c493d498a2f (diff) | |
| download | cpython-git-1e0d82cece755018a022acd5d1f7c0eb890e03db.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 bebeba2132..51b771760f 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -789,7 +789,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) |
