diff --git a/python/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java b/python/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java index c3fd23bc289c..136a7073bb8b 100644 --- a/python/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java +++ b/python/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java @@ -15,11 +15,14 @@ */ package com.jetbrains.python.psi.impl; +import com.intellij.facet.Facet; +import com.intellij.facet.FacetManager; import com.intellij.openapi.application.Application; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.fileTypes.FileTypeManager; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleManager; +import com.intellij.openapi.module.ModuleType; import com.intellij.openapi.module.ModuleUtilCore; import com.intellij.openapi.project.Project; import com.intellij.openapi.projectRoots.Sdk; @@ -37,6 +40,8 @@ import com.intellij.util.containers.WeakHashMap; import com.intellij.util.io.DataInputOutputUtil; import com.intellij.util.messages.MessageBus; import com.jetbrains.python.PythonFileType; +import com.jetbrains.python.PythonModuleTypeBase; +import com.jetbrains.python.facet.PythonFacetSettings; import com.jetbrains.python.psi.LanguageLevel; import com.jetbrains.python.sdk.PythonSdkType; import org.jetbrains.annotations.NotNull; @@ -61,11 +66,13 @@ public class PythonLanguageLevelPusher implements FilePropertyPusher usedSdks = new HashSet(); for (Module module : modules) { - final Sdk sdk = PythonSdkType.findPythonSdk(module); - myModuleSdks.put(module, sdk); - if (sdk != null && !usedSdks.contains(sdk)) { - usedSdks.add(sdk); - updateSdkLanguageLevel(project, sdk); + if (isPythonModule(module)) { + final Sdk sdk = PythonSdkType.findPythonSdk(module); + myModuleSdks.put(module, sdk); + if (sdk != null && !usedSdks.contains(sdk)) { + usedSdks.add(sdk); + updateSdkLanguageLevel(project, sdk); + } } } } @@ -167,17 +174,19 @@ public class PythonLanguageLevelPusher implements FilePropertyPusher