def __init__(self, function, scope, message=None):
        """Construct a LoginOrScopeRequired exception.

        :param function: The function that requires authentication.
        :param scope: The scope that is required if not logged in.
        :param message: A custom message to associate with the exception.
            Default: `function` requires a logged in session or the OAuth2
            scope `scope`

        """
        if not message:
            message = ('`{0}` requires a logged in session or the '
                       'OAuth2 scope `{1}`').format(function, scope)
        super(LoginOrScopeRequired, self).__init__(function, scope, message)
Construct a LoginOrScopeRequired exception.

        :param function: The function that requires authentication.
        :param scope: The scope that is required if not logged in.
        :param message: A custom message to associate with the exception.
            Default: `function` requires a logged in session or the OAuth2
            scope `scope`

        
rtv/packages/praw/errors.py