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 for 'import-self' #2617

Closed
kain88-de opened this issue Nov 28, 2018 · 5 comments
Closed

false positive for 'import-self' #2617

kain88-de opened this issue Nov 28, 2018 · 5 comments
Labels
Milestone

Comments

@kain88-de
Copy link

Steps to reproduce

  1. checkout mdanalysis
  2. install newest pylint
  3. cd mdanalysis/package && pylint MDAnalysis

Current behavior

Empty function with a pass statement fails the lint. See for example

Corresponding failing travis job
and issue MDAnalysis/mdanalysis#2148

Expected behavior

Code is fine

pylint --version output

https://travis-ci.org/MDAnalysis/mdanalysis/jobs/460318184#L681

This only happens with the newest version. Older versions of pylint do not report an error.

@orbeckst
Copy link

empty function with a pass statement fails the lint.

I think you meant something like "standard relative import semantics from . import some_mod fail the lint", as show in the linked example.

@PCManticore
Copy link
Contributor

Thanks for reporting the bug!

@ajasmin
Copy link

ajasmin commented Sep 18, 2020

In a module named foo.threading, I have:

import threading

For which in pylint 2.6.0 yields import-self

I believe that since python now uses absolute imports, it should unambiguously import threading from the standard library and the diagnostic is incorrect.

Edit: This specific case reported as #3665

@DanielNoord
Copy link
Collaborator

@Pierre-Sassoulas I cannot reproduce this. Might have been fixed!

@Pierre-Sassoulas
Copy link
Member

Closing as the issue is pointing to code that evolved since and it has a duplicate.

@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.10.0 milestone Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants