def _verify_is_integer_type(A, function_name):
    """
    _verify_is_integer_type(array, "function")

    Checks that ``A`` is an integer array. If it is not, it raises
    ``TypeError``.

    Parameters
    ----------
    A : ndarray
    function_name : str
        Used for error messages
    """
    k = A.dtype.kind
    if k not in 'iub':
        raise TypeError(
            'mahotas.%s: This function only accepts integer types (passed array of type %s)'
             % (function_name, A.dtype))
