def exception_match(typingctx, exc_value, exc_class):
    """Basically do ``isinstance(exc_value, exc_class)`` for exception objects.
    Used in ``except Exception:`` syntax.
    """
    # Check for our limitation
    if exc_class.exc_class is not Exception:
        msg = "Exception matching is limited to {}"
        raise errors.UnsupportedError(msg.format(Exception))

    def codegen(context, builder, signature, args):
        # Intentionally always True.
        return cgutils.true_bit

    restype = types.boolean
    return restype(exc_value, exc_class), codegen
Basically do ``isinstance(exc_value, exc_class)`` for exception objects.
    Used in ``except Exception:`` syntax.
    
numba/core/unsafe/eh.py