diff --git a/python/python-exec-service/src/com/intellij/python/community/execService/api.kt b/python/python-exec-service/src/com/intellij/python/community/execService/api.kt index 86018c21cb9c..b9c432500e49 100644 --- a/python/python-exec-service/src/com/intellij/python/community/execService/api.kt +++ b/python/python-exec-service/src/com/intellij/python/community/execService/api.kt @@ -5,7 +5,7 @@ import com.intellij.platform.eel.EelApi import com.intellij.python.community.execService.impl.ExecServiceImpl import com.jetbrains.python.PythonBinary import com.jetbrains.python.Result -import com.jetbrains.python.errorProcessing.PyError +import com.jetbrains.python.errorProcessing.PyError.ExecException import org.jetbrains.annotations.ApiStatus import org.jetbrains.annotations.CheckReturnValue import org.jetbrains.annotations.Nls @@ -28,7 +28,7 @@ interface ExecService { */ @ApiStatus.Internal @CheckReturnValue - suspend fun execGetStdout(whatToExec: WhatToExec, args: List = emptyList(), processDescription: @Nls String? = null, timeout: Duration = 1.minutes): Result + suspend fun execGetStdout(whatToExec: WhatToExec, args: List = emptyList(), processDescription: @Nls String? = null, timeout: Duration = 1.minutes): Result } sealed interface WhatToExec { diff --git a/python/python-exec-service/src/com/intellij/python/community/execService/impl/ExecServiceImpl.kt b/python/python-exec-service/src/com/intellij/python/community/execService/impl/ExecServiceImpl.kt index b32a9bffc556..ba420eda06cf 100644 --- a/python/python-exec-service/src/com/intellij/python/community/execService/impl/ExecServiceImpl.kt +++ b/python/python-exec-service/src/com/intellij/python/community/execService/impl/ExecServiceImpl.kt @@ -12,7 +12,7 @@ import com.intellij.python.community.execService.ExecService import com.intellij.python.community.execService.WhatToExec import com.jetbrains.python.PythonHelpersLocator import com.jetbrains.python.Result -import com.jetbrains.python.errorProcessing.PyError +import com.jetbrains.python.errorProcessing.PyError.ExecException import com.jetbrains.python.errorProcessing.failure import com.jetbrains.python.execution.FailureReason import com.jetbrains.python.execution.userMessage @@ -25,7 +25,7 @@ import kotlin.time.Duration internal object ExecServiceImpl : ExecService { - override suspend fun execGetStdout(whatToExec: WhatToExec, args: List, processDescription: @Nls String?, timeout: Duration): Result { + override suspend fun execGetStdout(whatToExec: WhatToExec, args: List, processDescription: @Nls String?, timeout: Duration): Result { val (eel, exe, args) = when (whatToExec) { is WhatToExec.Binary -> Triple(whatToExec.binary.getEelDescriptor().upgrade(), whatToExec.binary.pathString, args) is WhatToExec.Helper -> { @@ -54,7 +54,7 @@ private suspend fun EelApi.execGetStdoutImpl( args: List, processDescription: @Nls String, timeout: Duration, -): Result { +): Result { val process = exec.executeProcess(exe, *args.toTypedArray()).getOr { err -> val text = PyExecBundle.message("py.exec.start.error", processDescription, err.error.message, err.error.errno) val failure = PyExecFailureImpl(exe, args, text, FailureReason.CantStart)