Author: Philip Jenvey <pjen...@underboss.org>
Branch: py3k
Changeset: r72671:8afd884adfe3
Date: 2014-08-03 10:49 -0700
http://bitbucket.org/pypy/pypy/changeset/8afd884adfe3/

Log:    merge default

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
@@ -78,22 +78,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
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to