Commit b0cb54f5 authored by Philip Jenvey's avatar Philip Jenvey

more cleanup

parent 37812027
...@@ -94,22 +94,13 @@ def _classdir(klass): ...@@ -94,22 +94,13 @@ def _classdir(klass):
recursively. recursively.
""" """
names = set() names = set()
try: ns = getattr(klass, '__dict__', None)
names.update(klass.__dict__) if ns is not None:
except AttributeError: names.update(ns)
pass bases = getattr(klass, '__bases__', None)
try: if bases is not None:
# XXX - Use of .__mro__ would be suggested, if the existance of # Note that since we are only interested in the keys, the order
# that attribute could be guarranted. # we merge classes is unimportant
bases = klass.__bases__ for base in bases:
except AttributeError: names.update(_classdir(base))
pass
else:
try:
# Note that since we are only interested in the keys, the
# order we merge classes is unimportant
for base in bases:
names.update(_classdir(base))
except TypeError:
pass
return names return names
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment