You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a simple package folder with a pair of scripts that use a relative import.
mkdir pkg_folder
cd pkg_folder
touch __init__.py
code test0.py test1.py
test0.py
classTest0:
def__init__(self):
pass
test1.py
from .test0importTest0classTest1:
def__init__(self):
super().__init__()
pass
Notice that pylint is giving you an 'Attempted relative import beyond top-level package' error.
3. Verify that you are not going crazy: Install an older version of pylint that should work correctly.
pip install pylint==2.4.4
The error went away.
In other words, there's something wrong with version 2.5.2.
Current behavior
pylint is gives an 'Attempted relative import beyond top-level package' error when it is not warranted. This is a false positive.
Hello, thank you for reporting this problem. When you report a bug please do not use screenshot as it's not searchable (not readable by screen readers and impossible to find with a web search), instead copy paste the text output :)
There is less chance that we'll have to handle duplicate issues that way.
Steps to reproduce
pip install pylint==2.5.2
test0.py
test1.py
Notice that pylint is giving you an 'Attempted relative import beyond top-level package' error.
3. Verify that you are not going crazy: Install an older version of pylint that should work correctly.
pip install pylint==2.4.4
The error went away.
In other words, there's something wrong with version 2.5.2.
Current behavior
pylint is gives an 'Attempted relative import beyond top-level package' error when it is not warranted. This is a false positive.
Expected behavior
This error should not be shown.
pylint --version output
pylint 2.5.2
astroid 2.4.1
Python 3.7.3 (default, Jul 10 2019, 16:01:05)
[GCC 7.4.0]
The text was updated successfully, but these errors were encountered: