Hi

I find that PyLint ignores a disable-msg directive within an else block, as
linting the attached code produces this message:

E: 11:find_exe: Module 'pywintypes' has no 'error' member


Is this behaviour intentional? If I move the directive to the beginning of
the function, it works.

Thanks,
Arve
def find_exe(executable):
    """Find exe."""
    try:
        import win32api, pywintypes
    except ImportError:
        pass
    else:
        # pylint: disable-msg=E1101
        try:
            return win32api.FindExecutable(executable)[1]
        except pywintypes.error:
            pass
        raise Exception(executable)
_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to