[Python-projects] Pylint bug or feature?

Sylvain Thénault sylvain.thenault at logilab.fr
Mon Aug 20 17:55:47 CEST 2007


On Friday 17 August à 15:04, Dalton, Tom wrote:
> 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 ;-)

asking questions on the mailing list is usually a good option :) I did
reproduce your problem using your code snippet and opened a ticket for
it: http://www.logilab.org/bug/eid/4087

thanks for the report, regards
-- 
Sylvain Thénault                               LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
Python et calcul scientifique:           http://www.logilab.fr/science



More information about the Python-Projects mailing list