This commit is contained in:
Dmitry Jemerov
2011-06-24 19:05:28 +02:00
parent 233472ef25
commit 8be451defd
2 changed files with 3 additions and 1 deletions
@@ -288,7 +288,7 @@ public class PyFileImpl extends PsiFileBase implements PyFile, PyExpression {
// http://stackoverflow.com/questions/6048786/from-module-import-in-init-py-makes-module-name-visible
if (PyNames.INIT_DOT_PY.equals(getName())) {
final PyQualifiedName qName = stub.getImportSourceQName();
if (qName.endsWith(name)) {
if (qName != null && qName.endsWith(name)) {
final PsiElement element = PyUtil.turnInitIntoDir(ResolveImportUtil.resolveFromImportStatementSource(stub.getPsi()));
if (element != null && element.getParent() == getContainingDirectory()) {
return element;
@@ -3,11 +3,13 @@ package com.jetbrains.python.psi.stubs;
import com.intellij.psi.stubs.StubElement;
import com.jetbrains.python.psi.PyFromImportStatement;
import com.jetbrains.python.psi.impl.PyQualifiedName;
import org.jetbrains.annotations.Nullable;
/**
* @author yole
*/
public interface PyFromImportStatementStub extends StubElement<PyFromImportStatement> {
@Nullable
PyQualifiedName getImportSourceQName();
boolean isStarImport();
int getRelativeLevel();