warnings.UserWarning
not suppressed when importing modules to parse their syntax trees.
#7906
Labels
Enhancement ✨
Improvement to a component
Needs astroid update
Needs an astroid update (probably a release too) before being mergable
Milestone
Bug description
The following code:
produces the following warning when scanned with
pylint
:This output is confusing as it is triggered by the code being scanned and not by anything that Pylint uses internally.
Configuration
No response
Command used
Pylint output
.../site-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils. warnings.warn("Setuptools is replacing distutils.")
Expected behavior
I would expect no
UserWarning
for something related to Setuptools while scanning code with Pylint.While I think that this is mostly a toxic interaction between Setuptools and Pip imports, Pylint (or Astroid) could suppress these warnings by wrapping the imports needed for AST parsing with the
warnings.catch_warnings
context manager or something along those lines.Pylint version
OS / Environment
No response
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: