(f)
return wrapper
decorator that catches and logs any exceptions.
    the exceptions are swallowed, and `0` is returned.

    this is useful for routines that IDA invokes, as IDA bails on exceptions.

    Example::

        @no_exceptions
        def definitely_doesnt_work():
            raise ZeroDivisionError()

        assert definitely_doesnt_work() == 0
decorator that catches and logs any exceptions.
    the exceptions are swallowed, and `0` is returned.
decorator that catches and logs any exceptions . the exceptions are swallowed and 0 is returned .
def no_exceptions(f):
    '''
    decorator that catches and logs any exceptions.
    the exceptions are swallowed, and `0` is returned.

    this is useful for routines that IDA invokes, as IDA bails on exceptions.

    Example::

        @no_exceptions
        def definitely_doesnt_work():
            raise ZeroDivisionError()

        assert definitely_doesnt_work() == 0
    '''
    @functools.wraps(f)
    def wrapper(*args, **kwargs):
        try:
            return f(*args, **kwargs)
        # we explicitly want to catch all exceptions here,
        # because IDA cannot handle them.
        except:  # NOQA: E722 do not use bare 'except'
            logger.error('exception in %s', f.__name__, exc_info=True)
            return 0
    return wrapper
def no_exceptions ( f ) : @ functools . wraps ( f ) def wrapper ( * args , * * kwargs ) : try : return f ( * args , * * kwargs ) # we explicitly want to catch all exceptions here, # because IDA cannot handle them. except : # NOQA: E722 do not use bare 'except' logger . error ( 'exception in %s' , f . __name__ , exc_info = True ) return 0 return wrapper