[Python-projects] pylint false positive: More than one statement on a single line

Sylvain Thénault sylvain.thenault at logilab.fr
Thu Mar 26 08:26:45 CET 2009


Le Thursday 26 March 2009 00:01:45 Maarten ter Huurne, vous avez écrit :
> Hi,

Hi Maarten,

> The new pylint works well on Python 2.6 now.
> Thanks for fixing it so quickly!

it was a shame to have done all this work and not seeing it working with 
2.6 ;) And the fix was not that hard, I originally thought we would have to 
stop relying on monkey-patching in astng (which would have been a great 
pain), but it was actually only concerning the base _ast.AST class.

> I did encounter this false positive, which I think is new, although I'm not
> 100% sure about that.

yes it's new.

> ===
> try:
> 	pass
> except IOError:
> 	pass
> finally:
> 	pass
> ===
> C0321:  1: More than one statement on a single line
>
> The message is only output if the "try" statement has both an "except" and
> a "finally" clause.

yep, I guess a new node has been introduced for  this and we forgot to deal 
with it in astng.

http://www.logilab.org/ticket/8764

thanks for the testing and all those reports!
-- 
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