diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java index 45cfb0b6bae2..6fe61a181a9c 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java @@ -18,8 +18,6 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.project.ProjectManager; import com.intellij.openapi.projectRoots.Sdk; import com.intellij.openapi.roots.*; -import com.intellij.openapi.roots.impl.DirectoryIndex; -import com.intellij.openapi.roots.impl.DirectoryInfo; import com.intellij.openapi.roots.impl.FilePropertyPusher; import com.intellij.openapi.roots.impl.PushedFilePropertiesUpdater; import com.intellij.openapi.util.Key; @@ -341,8 +339,7 @@ public final class PythonLanguageLevelPusher implements FilePropertyPusher { if (myProject.isDisposed() || !myRoot.isValid()) return null; - DirectoryInfo info = DirectoryIndex.getInstance(myProject).getInfoForFile(myRoot); - Module module = info.getModule(); + Module module = ProjectFileIndex.getInstance(myProject).getModuleForFile(myRoot, false); if (module == null) return null; return ModuleRootManager.getInstance(module).getFileIndex(); });