[Python-projects] PyLint: Disabling message in "except" clause works in a strange way

Maarten ter Huurne maarten.ter.huurne at philips.com
Thu Nov 23 16:01:00 CET 2006


Hi,

If I run PyLint on this:
===
try:
        pass
except: # pylint: disable-msg=W0702
        print 'failed to do nothing'
===
The W0702 warning is issued even though I attempted to disable it.

If I run PyLint on this:
===
try:
        pass
except:
        # pylint: disable-msg=W0702
        print 'failed to do nothing'
===
The W0702 warning is still issued.

But if I run PyLint on this:
===
try:
        pass
except:
        print 'failed to do nothing' # pylint: disable-msg=W0702
===
The W0702 warning is suppressed.

I would expect the first form to be the one that works, not the third.

PyLint 0.12.1, astng 0.16.2, common 0.21.0

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


More information about the Python-Projects mailing list