mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fixed PY-11047 "Python version 3.3 does not have module exceptions" on relative import
do not run inspection on relative imports
This commit is contained in:
@@ -239,6 +239,7 @@ public class PyCompatibilityInspection extends PyInspection {
|
||||
@Override
|
||||
public void visitPyFromImportStatement(PyFromImportStatement node) {
|
||||
super.visitPyFromImportStatement(node);
|
||||
if (node.getRelativeLevel() > 0) return;
|
||||
int len = 0;
|
||||
StringBuilder message = new StringBuilder("Python version ");
|
||||
PyQualifiedName name = node.getImportSourceQName();
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<warning descr="Python version 2.4 doesn't support this syntax.">from ..exceptions import ServiceDoesNotExists</warning>
|
||||
@@ -130,6 +130,11 @@ public class PyCompatibilityInspectionTest extends PyTestCase {
|
||||
doTest(LanguageLevel.PYTHON33);
|
||||
}
|
||||
|
||||
// PY-11047
|
||||
public void testRelativeImport() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest(@NotNull LanguageLevel level) {
|
||||
runWithLanguageLevel(level, new Runnable() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user