On 11/19/07, Jeremy Hylton <firstname.lastname@example.org> wrote:
> This is a bug report for pylint version 0.13.2. We've got a custom
> checker that adds a message for lambda nodes that are too long. In
> some cases (perhaps all?) the node passed to add_message() has
> fromlineno set to None. In those cases, the line number for the
> warning message is 1. I see there's some commented out code in
> add_message() that seems to concern itself with the same problem. I
> have that changing add_message to consider lineno as well seemed to
> fix our problem.
> def add_message(self, msg_id, line=None, node=None, args=None):
> """add the message corresponding to the given id.
> If provided, msg is expanded using args
> astng checkers should provide the node argument, raw checkers should
> provide the line argument.
> if line is None and node is not None:
> line = node.fromlineno or node.lineno
> Is there a better way to fix this problem?