mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
suppress unresolved reference error under PyImportedModuleType (PY-2075)
This commit is contained in:
@@ -400,7 +400,8 @@ public class PyUnresolvedReferencesInspection extends PyInspection {
|
||||
PyType qtype = myTypeEvalContext.getType(qualifier);
|
||||
if (qtype != null) {
|
||||
if (qtype instanceof PyNoneType || qtype instanceof PyTypeReference ||
|
||||
(qtype instanceof PyUnionType && ((PyUnionType) qtype).isWeak())) {
|
||||
(qtype instanceof PyUnionType && ((PyUnionType) qtype).isWeak()) ||
|
||||
(qtype instanceof PyImportedModuleType)) {
|
||||
// this almost always means that we don't know the type, so don't show an error in this case
|
||||
return;
|
||||
}
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import <warning descr="Unresolved reference 'deliverance'">deliverance</warning>.proxycommand
|
||||
deliverance.proxycommand.main()
|
||||
+4
@@ -64,6 +64,10 @@ public class PyUnresolvedReferencesInspectionTest extends PyTestCase {
|
||||
public void testTypeAssertions() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testUnresolvedImportedModule() { // PY-2075
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testImportToContainingFile() { // PY-4372
|
||||
myFixture.copyFileToProject("inspections/PyUnresolvedReferencesInspection/__init__.py", "PyUnresolvedReferencesInspection/__init__.py");
|
||||
|
||||
Reference in New Issue
Block a user