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

False positive deprecated-method with alias to non-deprecated method #5886

Closed
kjamieson opened this issue Mar 9, 2022 · 3 comments · Fixed by #7795
Closed

False positive deprecated-method with alias to non-deprecated method #5886

kjamieson opened this issue Mar 9, 2022 · 3 comments · Fixed by #7795
Assignees
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation Regression
Milestone

Comments

@kjamieson
Copy link

kjamieson commented Mar 9, 2022

Bug description

With pylint 2.12.2 and python 3.8 the following code:

import time

def test(clock = time.time):
    clock()

Produces a false-positive deprecated-method warning:

test.py:4:4: W1505: Using deprecated method clock() (deprecated-method)

I think this is related to the deprecated alias detection added in #4618 as the issue does not reproduce with that change reverted.

Configuration

No response

Command used

pylint test.py

Pylint output

test.py:4:4: W1505: Using deprecated method clock() (deprecated-method)

Expected behavior

No warning.

Pylint version

2.12.2

OS / Environment

Ubuntu 18.04

Additional dependencies

No response

@kjamieson kjamieson added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Mar 9, 2022
@DanielNoord DanielNoord added False Positive 🦟 A message is emitted but nothing is wrong with the code Regression and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Mar 14, 2022
@Pierre-Sassoulas
Copy link
Member

I can't reproduce on 2.15.0-dev0, I suppose it was fixed in #4619

@Pierre-Sassoulas
Copy link
Member

Reopening in order to close with a regression test.

@Pierre-Sassoulas Pierre-Sassoulas added the Needs PR This issue is accepted, sufficiently specified and now needs an implementation label Jul 6, 2022
@clavedeluna
Copy link
Collaborator

I'm actually able to reproduce this with pylint 2.15.4, so a fix + regression test is needed.

@clavedeluna clavedeluna self-assigned this Nov 18, 2022
clavedeluna added a commit to clavedeluna/pylint that referenced this issue Nov 18, 2022
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.15.7 milestone Nov 19, 2022
Pierre-Sassoulas pushed a commit that referenced this issue Nov 19, 2022
When alias for method is similar to name of deprecated method.

Closes #5886
github-actions bot pushed a commit that referenced this issue Nov 19, 2022
When alias for method is similar to name of deprecated method.

Closes #5886

(cherry picked from commit 57f38c3)
Pierre-Sassoulas pushed a commit that referenced this issue Nov 22, 2022
When alias for method is similar to name of deprecated method.

Closes #5886

(cherry picked from commit 57f38c3)
Pierre-Sassoulas pushed a commit that referenced this issue Nov 23, 2022
When alias for method is similar to name of deprecated method.

Closes #5886

(cherry picked from commit 57f38c3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation Regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants