PY-61413 Freeze due to non-cancelable RA in PythonLanguageLevelPusher

Do not iterate over all files in a directory. Because PythonSdkPathCache defined by SDK and SDK can be found by a directory

GitOrigin-RevId: 9575e24b9c38a3203f387e8aaea32ab28507be4c
This commit is contained in:
Andrey Vokin
2024-06-21 20:38:56 +02:00
committed by intellij-monorepo-bot
parent d122d5e58d
commit 3f81ae2ba0

View File

@@ -154,10 +154,8 @@ public final class PythonLanguageLevelPusher implements FilePropertyPusher<Langu
if (!areLanguageLevelsCompatible(oldLanguageLevel, level) || !ProjectFileIndex.getInstance(project).isInContent(fileOrDir)) {
PushedFilePropertiesUpdater.getInstance(project).filePropertiesChanged(fileOrDir, PythonLanguageLevelPusher::isPythonFile);
}
for (VirtualFile child : fileOrDir.getChildren()) {
if (!child.isDirectory() && isPythonFile(child)) {
clearSdkPathCache(child);
}
if (fileOrDir.isDirectory() || isPythonFile(fileOrDir)) {
clearSdkPathCache(fileOrDir);
}
}