[Python-projects] pylint: W0706

Maarten ter Huurne maarten.ter.huurne at philips.com
Wed Jul 30 14:27:15 CEST 2008


Hi,

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
 line 1
===

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)

Bye,
            Maarten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.logilab.org/pipermail/python-projects/attachments/20080730/ea68312e/attachment.htm 


More information about the Python-Projects mailing list