Commits

Amaury Forgeot d'Arc  committed 85551fc

fix test_descriptor

  • Participants
  • Parent commits a61b0fd
  • Branches py3k

Comments (0)

Files changed (1)

File pypy/module/__builtin__/app_inspect.py

 
     obj = args[0]
 
-    dir_meth = None
-    if isinstance(obj, types.InstanceType):
-        try:
-            dir_meth = getattr(obj, "__dir__")
-        except AttributeError:
-            pass
-    else:
-        dir_meth = lookup_special(obj, "__dir__")
+    dir_meth = lookup_special(obj, "__dir__")
     if dir_meth is not None:
         result = dir_meth()
         if not isinstance(result, list):
         except AttributeError:
             return []
 
-    elif isinstance(obj, (types.TypeType, types.ClassType)):
+    elif isinstance(obj, type):
         #Don't look at __class__, as metaclass methods would be confusing.
         result = _classdir(obj).keys()
         result.sort()