Pylint: False no-member on psycopg2.errors

Created on 6 Jun 2019  路  1Comment  路  Source: PyCQA/pylint

Steps to reproduce

Run pylint on code using any member of psycopg2.error. For example:

import psycopg2.errors
raise psycopg2.errors.InvalidSqlStatementName()

Current behavior

no-member(E1101): Module 'psycopg2.errors' has no 'XXX' member

Expected behavior

No issue

Note

According to a comment in psycopg2/errors.py, the exceptions are injected into the module by the C extension.

pylint --version output

pylint 2.3.1
astroid 2.2.5
Python 3.7.3 (default, Mar 27 2019, 09:52:24)
[GCC 7.3.0]

Most helpful comment

Well there is not much pylint can do about this. If these are injected automatically, especially from a C extension, I'd recommend ignoring the module entirely with --ignored-modules=psycopg2.errors.

>All comments

Well there is not much pylint can do about this. If these are injected automatically, especially from a C extension, I'd recommend ignoring the module entirely with --ignored-modules=psycopg2.errors.

Was this page helpful?
0 / 5 - 0 ratings