From 3f57680f93fd8ee35b7352fa0470f94b457f4349 Mon Sep 17 00:00:00 2001 From: Phodal Huang Date: Fri, 29 Nov 2024 22:32:38 +0800 Subject: [PATCH] fix: set default python execute to python 3 and update && closed #146 --- .../com/phodal/shirecore/provider/shire/FileRunService.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/kotlin/com/phodal/shirecore/provider/shire/FileRunService.kt b/core/src/main/kotlin/com/phodal/shirecore/provider/shire/FileRunService.kt index 6e9183f5f..838fed81b 100644 --- a/core/src/main/kotlin/com/phodal/shirecore/provider/shire/FileRunService.kt +++ b/core/src/main/kotlin/com/phodal/shirecore/provider/shire/FileRunService.kt @@ -150,7 +150,7 @@ interface FileRunService { fun runInCli(project: Project, psiFile: PsiFile, args: List? = null): String? { val commandLine = when (psiFile.language.displayName.lowercase()) { - "python" -> GeneralCommandLine("python", psiFile.virtualFile.path) + "python" -> GeneralCommandLine("python3", psiFile.virtualFile.path) "javascript" -> GeneralCommandLine("node", psiFile.virtualFile.path) "ecmascript 6" -> GeneralCommandLine("node", psiFile.virtualFile.path) "ruby" -> GeneralCommandLine("ruby", psiFile.virtualFile.path) @@ -173,7 +173,7 @@ interface FileRunService { output.stdout } catch (e: Exception) { e.printStackTrace() - null + e.message } } @@ -181,6 +181,7 @@ interface FileRunService { val psiFile = runReadAction { PsiManager.getInstance(project).findFile(virtualFile) } ?: return null + return runInCli(project, psiFile, args) }