Author: Philip Jenvey <[email protected]>
Branch:
Changeset: r72670:971aedb02438
Date: 2014-08-03 10:48 -0700
http://bitbucket.org/pypy/pypy/changeset/971aedb02438/
Log: more cleanup
diff --git a/pypy/module/__builtin__/app_inspect.py
b/pypy/module/__builtin__/app_inspect.py
--- a/pypy/module/__builtin__/app_inspect.py
+++ b/pypy/module/__builtin__/app_inspect.py
@@ -94,22 +94,13 @@
recursively.
"""
names = set()
- try:
- names.update(klass.__dict__)
- except AttributeError:
- pass
- try:
- # XXX - Use of .__mro__ would be suggested, if the existance of
- # that attribute could be guarranted.
- bases = klass.__bases__
- except AttributeError:
- 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
+ ns = getattr(klass, '__dict__', None)
+ if ns is not None:
+ names.update(ns)
+ bases = getattr(klass, '__bases__', None)
+ if bases is not None:
+ # 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))
return names
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit