[Python-projects] Pylint bug or feature?

Dalton, Tom tom.dalton at eds.com
Fri Aug 17 15:04:39 CEST 2007


Hi,

In pylint 0.13.1, pylniting the following code results in an "E1010: Raising a new style class"

class C(object):

    class E(Exception):
        pass

    @staticmethod
    def test():
        raise C.E() # This line generates the pylint error


I haven't tested this on the latest version of pylint, because it's difficult to do so in my workplace, however, the code does run on Python 2.4.0. I saw that there was at least one other bug on the mailing list relating to Pylint not correctly handling nested classes, and a quick look at the relevant pylint code suggests that when pylint tries to get the class info of C.E on the line in error, it's actually getting the class info for C. Either way, I couldn't see this exact issue on the mailing list of bug list, so thought I should raise it ;-)

Regards,

Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.logilab.org/pipermail/python-projects/attachments/20070817/1f2e1d34/attachment.htm 


More information about the Python-Projects mailing list