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

-- 
Sylvain Thénault                               LOGILAB, Paris (France)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
CubicWeb, the semantic web framework:    http://www.cubicweb.org

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

Reply via email to