def safe_isclass(obj):
    'Ignore any exception via isinstance on Python 3.'
    try:
        return inspect.isclass(obj)
    except Exception:
        return False
Ignore any exception via isinstance on Python 3.
def safe_isclass(obj):
    
    try:
        return inspect.isclass(obj)
    except Exception:
        return False