Am 18.04.2020 um 17:23 schrieb Justin Pryzby:
> That didn't work.
>
> It did work to do this:
> ProgrammingError = _pg.ProgrammingError
>
> Maybe __all__ can *limits* what's visible but not extend it.  ?

It actually only defines what will be imported when you do a wildcard import, and I suspected it could be used by pylint as well.

I have added __all__ attributes to pg and pgdb now anyway.

If pylint still complains, then it is a pylint issue. The message "No name ProgrammingError in module pg" is definitely wrong - it looks like pylint cannnot interpret the "from _pg import *" statement, maybe because it cannot process C extensions.

Others have reported this issue already here:

https://github.com/PyCQA/pylint/issues/1138
https://github.com/PyCQA/pylint/issues/1524

Probably best to use the workaound given there,
i.e. setting extension-pkg-whitelist=pg in this case.

You can also try using flake8 instead of pylint, they have both their pro's and con's.

-- Christoph


_______________________________________________
PyGreSQL mailing list
PyGreSQL@Vex.Net
https://mail.vex.net/mailman/listinfo/pygresql

Reply via email to