Skip to content

W0406: Module import itself (import-self) in __init__.py #3933

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

Open
vestronge opened this issue Nov 1, 2020 · 1 comment
Open

W0406: Module import itself (import-self) in __init__.py #3933

vestronge opened this issue Nov 1, 2020 · 1 comment
Labels
Bug 🪲 False Positive 🦟 A message is emitted but nothing is wrong with the code Import system Needs PR This issue is accepted, sufficiently specified and now needs an implementation

Comments

@vestronge
Copy link

app
├── settings
│   ├── __init__.py
│   ├── base.py
│   ├── local.py

And init.py is

try:
    from .local import *
except ImportError:
    from .base import *

Steps to reproduce

  1. set -e; pylint app/

Current behavior

************* Module settings
settings/init.py:4:4: W0406: Module import itself (import-self)

Expected behavior

There shouldn't be any error

pylint --version output

pylint version 2.6.0
python version 3.6.8
@hippo91
Copy link
Contributor

hippo91 commented Nov 17, 2020

@vestronge thanks for the report.

@hippo91 hippo91 added Bug 🪲 False Positive 🦟 A message is emitted but nothing is wrong with the code Import system labels Nov 17, 2020
@Pierre-Sassoulas Pierre-Sassoulas added the Needs PR This issue is accepted, sufficiently specified and now needs an implementation label Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 False Positive 🦟 A message is emitted but nothing is wrong with the code Import system Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Projects
None yet
Development

No branches or pull requests

3 participants