PY-80049: Check Python2 version correctly.

We execute `--version` to find python version.
Since 3.4 Python uses stdout for output, but before that it used stderr.

We now check both: stdout and stderr.

GitOrigin-RevId: ca9059b71cabbd1a94e26523192cdf9eeb8c1eb1
This commit is contained in:
Ilya.Kazakevich
2025-03-28 18:06:13 +00:00
committed by intellij-monorepo-bot
parent f313e649fd
commit 92b5532dc1
6 changed files with 41 additions and 15 deletions
@@ -41,7 +41,6 @@ abstract class PythonType<T : Any>(private val tag: @NonNls String) {
?: error("Can't get language level for $flavor , $binary")
}
.sortedByDescending { (_, languageLevel) -> languageLevel }
.filter { (_, languageLevel) -> languageLevel.isPy3K }
.map { (path, _) -> path }
}
return pythons.asFlow()
@@ -11,7 +11,7 @@ import com.jetbrains.python.PyNames
import com.jetbrains.python.PythonBinary
import java.nio.file.Path
data object TypeVanillaPython3 : PythonType<PythonBinary>("python3") {
open class TypeVanillaPython(tag: String) : PythonType<PythonBinary>(tag) {
override suspend fun createSdkFor(python: PythonBinary): Sdk = createSdk(python)
fun createSdk(python: PythonBinary): Sdk =
@@ -27,4 +27,6 @@ data object TypeVanillaPython3 : PythonType<PythonBinary>("python3") {
Disposer.dispose(disposable)
})
}
}
}
object TypeVanillaPython3 : TypeVanillaPython("python3")