Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[deprecated-x] Message trigger even in old interpreter compatibility code #10043

Open
Pierre-Sassoulas opened this issue Oct 24, 2024 · 0 comments
Labels
Control flow Requires control flow understanding False Positive 🦟 A message is emitted but nothing is wrong with the code Needs decision 🔒 Needs a decision before implemention or rejection

Comments

@Pierre-Sassoulas
Copy link
Member

Pierre-Sassoulas commented Oct 24, 2024

Bug description

if sys.version_info >= (3, 12):
    from importlib.resources.abc import TraversableResources
else:
    from importlib.abc import TraversableResources # [deprecated-class]

Command used

pylint a.py

Pylint output

************* Module a
W4904: Using deprecated class TraversableResources of module importlib.abc (deprecated-class)

Expected behavior

Not raise when the import isn't available in some python interpreters and sys guard are around (?)

Pylint version

pylint 3.3.1
astroid 3.3.5
Python 3.12.3 (main, Sep 11 2024, 14:17:37) [GCC 13.2.0]

@Pierre-Sassoulas Pierre-Sassoulas added Control flow Requires control flow understanding False Positive 🦟 A message is emitted but nothing is wrong with the code Needs decision 🔒 Needs a decision before implemention or rejection labels Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Control flow Requires control flow understanding False Positive 🦟 A message is emitted but nothing is wrong with the code Needs decision 🔒 Needs a decision before implemention or rejection
Projects
None yet
Development

No branches or pull requests

1 participant