diff --git a/python/psi-api/src/com/jetbrains/python/psi/LanguageLevel.java b/python/psi-api/src/com/jetbrains/python/psi/LanguageLevel.java index ae22e57e82ab..52ec5ae5de61 100644 --- a/python/psi-api/src/com/jetbrains/python/psi/LanguageLevel.java +++ b/python/psi-api/src/com/jetbrains/python/psi/LanguageLevel.java @@ -56,6 +56,7 @@ public enum LanguageLevel { public static LanguageLevel FORCE_LANGUAGE_LEVEL = null; + @NotNull public static LanguageLevel getDefault() { return DEFAULT2; } diff --git a/python/src/com/jetbrains/python/psi/PyUtil.java b/python/src/com/jetbrains/python/psi/PyUtil.java index 5ec8c8d0e16b..756683124644 100644 --- a/python/src/com/jetbrains/python/psi/PyUtil.java +++ b/python/src/com/jetbrains/python/psi/PyUtil.java @@ -828,7 +828,8 @@ public class PyUtil { return guessLanguageLevel(project); } - private static LanguageLevel guessLanguageLevel(@NotNull Project project) { + @NotNull + public static LanguageLevel guessLanguageLevel(@NotNull Project project) { final ModuleManager moduleManager = ModuleManager.getInstance(project); if (moduleManager != null) { for (Module projectModule : moduleManager.getModules()) { diff --git a/python/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java b/python/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java index c93f776948ba..a78934b33b12 100644 --- a/python/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java +++ b/python/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java @@ -49,6 +49,7 @@ 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.psi.PyUtil; import com.jetbrains.python.psi.resolve.PythonSdkPathCache; import com.jetbrains.python.sdk.PythonSdkType; import org.jetbrains.annotations.NotNull; @@ -108,7 +109,10 @@ public class PythonLanguageLevelPusher implements FilePropertyPusher