Issue 9732: __class__ no longer checked on objects by getattr_static
diff --git a/Lib/inspect.py b/Lib/inspect.py
index 2f05829..241cd08 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -1080,6 +1080,13 @@
             pass
     return _sentinel
 
+def _is_type(obj):
+    try:
+        _static_getmro(obj)
+    except TypeError:
+        return False
+    return True
+
 
 def getattr_static(obj, attr, default=_sentinel):
     """Retrieve attributes without triggering dynamic lookup via the
@@ -1093,7 +1100,7 @@
        documentation for details.
     """
     instance_result = _sentinel
-    if not isinstance(obj, type):
+    if not _is_type(obj):
         instance_result = _check_instance(obj, attr)
         klass = type(obj)
     else: