def compatibility_call(fn, *args):
    """Special call for compatibility with user-defined old-style rules
    with `settings` param.

    """
    fn_args_count = len(getargspec(fn).args)
    if fn.__name__ in ('match', 'get_new_command') and fn_args_count == 2:
        warn("Two arguments `{}` from rule `{}` is deprecated, please "
             "remove `settings` argument and use "
             "`from thefuck.conf import settings` instead."
             .format(fn.__name__, fn.__module__))
        args += (settings,)
    if fn.__name__ == 'side_effect' and fn_args_count == 3:
        warn("Three arguments `side_effect` from rule `{}` is deprecated, "
             "please remove `settings` argument and use `from thefuck.conf "
             "import settings` instead."
             .format(fn.__name__, fn.__module__))
        args += (settings,)
    return fn(*args)
dataset/ETHPy150Open nvbn/thefuck/thefuck/utils.py/compatibility_call/original