summaryrefslogtreecommitdiffstats
path: root/Lib/inspect.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-09-05 14:14:32 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-09-05 14:14:32 (GMT)
commit362c1b513d5b7354f50dd2371d178c493d498a2f (patch)
tree652aa05e30d5ce3965505bd4a59263f3d72890bc /Lib/inspect.py
parente1040e276b11f21b7007c139269c38d5eba04f5e (diff)
downloadcpython-362c1b513d5b7354f50dd2371d178c493d498a2f.zip
cpython-362c1b513d5b7354f50dd2371d178c493d498a2f.tar.gz
cpython-362c1b513d5b7354f50dd2371d178c493d498a2f.tar.bz2
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.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py
index c7e7ef5..9337bd5 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -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)