Skip to content

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

Open
@vestronge

Description

@vestronge
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug 🪲False Positive 🦟A message is emitted but nothing is wrong with the codeImport systemNeeds PRThis issue is accepted, sufficiently specified and now needs an implementation

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions