Bug description
When splitting the import for Windows and Linux, Pylint give a false positive for ungrouped-imports C0412.
The only way to remove this warning is to have an if/else for each import.
I think this bug is related to issues #7735 and #3382 .
Like in both issues it's not possible to regroup the import.
import os
if os.name == "nt":
from math import pi as
from pathlib import PurePosixPath
else:
from math import e
from pathlib import PureWindowsPath
Configuration
Command used
pylint ".\test_import.py"
Pylint output
test_import.py:8:4: C0412: Imports from package math are not grouped (ungrouped-imports)
test_import.py:9:4: C0412: Imports from package pathlib are not grouped (ungrouped-imports)
Expected behavior
Raise no issue
Pylint version
pylint 3.3.5
astroid 3.3.8
Python 3.12.5 | packaged by Anaconda, Inc. | (main, Sep 12 2024, 18:18:29) [MSC v.1929 64 bit (AMD64)]
OS / Environment
Windows
Additional dependencies
Bug description
When splitting the import for Windows and Linux, Pylint give a false positive for
ungrouped-imports C0412.The only way to remove this warning is to have an if/else for each import.
I think this bug is related to issues #7735 and #3382 .
Like in both issues it's not possible to regroup the import.
Configuration
Command used
pylint ".\test_import.py"Pylint output
Expected behavior
Raise no issue
Pylint version
OS / Environment
Windows
Additional dependencies