pylint #5672 W0706 weirdness [resolved]

maarten reported...

When I run pylint on the following code:

class MultiException(Exception):

  def __init__(self):
      Exception.__init__(self)
      self.messages = []

  def add_error(self, message):
      self.messages.append(message)
      return self

raise MultiException().add_error('blah')

I get the following output:

W0706: 11: Identifier MultiException().add_error('blah') used to raise an
exception is assigned to class MultiException(Exception):
  def __init__(self):
      Exception.__init__(self)
      self.messages = []
  def add_error(self, message):
      self.messages.append(message)
      return self

I don't understand what this warning is warning me about. Also, I think it's very strange that the class body is included in the warning.

Versions used: pylint 0.14.0, astng 0.17.2, common 0.22.1 Python 2.5.1 (r251:54863, Mar 7 2008, 03:41:45)

prioritynormal
typebug
done in0.15.2
load0.000
load left0.000
closed by<not specified>