suppress unresolved reference error under PyImportedModuleType (PY-2075)

This commit is contained in:
Dmitry Jemerov
2011-11-21 19:05:45 +01:00
parent 6bdfe527d9
commit ccb7e2fb63
3 changed files with 8 additions and 1 deletions
@@ -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;
}
@@ -0,0 +1,2 @@
import <warning descr="Unresolved reference 'deliverance'">deliverance</warning>.proxycommand
deliverance.proxycommand.main()
@@ -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");