On Wed, May 5, 2010 at 7:50 PM, Sylvain Thénault <
[email protected]> wrote:

> On 03 mai 14:43, Arve Knudsen wrote:
> > Hello
>
> Re,
>
> > How can one make PyLint not fail on optional imports? That is, in some of
> my
> > code I have a soft dependency on python-win32, like so:
> >
> > try: import win32api, pywintypes
> > except ImportError: pass
> >
> >
> > However, if python-win32 isn't installed, it makes PyLint fail with
> messages
> > like this: Unable to import 'win32api'. Is there any way to suppress this
> > error?
>
> run pylint with --include-ids=yes, then copy the message id and
> use the "# pylint: disable-msg=<msgid>" inline directive


Are there any plans to make PyLint understand the "except ImportError"
idiom? It's a pretty common pattern after all.

Thanks,
Arve
_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to