pylint-dev / pylint

It's not just a linter that annoys you!
https://pylint.readthedocs.io/en/latest/
GNU General Public License v2.0
5.34k stars 1.15k forks source link

`import-self` false positive when importing non-existing module from current package #3748

Open vlad0337187 opened 4 years ago

vlad0337187 commented 4 years ago

Steps to reproduce

  1. create some module
  2. try to import non-existing module from current package in __init__.py
  3. run pylint ./

Current behavior

Expected behavior

pylint --version output

pylint 2.5.3
astroid 2.4.2
Python 3.8.3 (default, May 29 2020, 00:00:00) 
[GCC 10.1.1 20200507 (Red Hat 10.1.1-1)]

Reproduce case

dubiousjim commented 1 month ago

Related issues: #3665, #5151, #6535, #7289