From 09be752bc16b9db4587a89ca0dd62c96f236990a Mon Sep 17 00:00:00 2001 From: vapao Date: Mon, 27 Dec 2021 16:07:07 +0800 Subject: [PATCH] =?UTF-8?q?U=20=E6=89=B9=E9=87=8F=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E9=80=89=E6=8B=A9Python=E6=97=B6=E5=B0=86=E4=BC=98=E5=85=88?= =?UTF-8?q?=E4=BD=BF=E7=94=A8python3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_api/apps/exec/executors.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spug_api/apps/exec/executors.py b/spug_api/apps/exec/executors.py index 7183004..7a0d0b8 100644 --- a/spug_api/apps/exec/executors.py +++ b/spug_api/apps/exec/executors.py @@ -38,7 +38,8 @@ class Job: def _handle_command(self, command, interpreter): if interpreter == 'python': - return f'python << EOF\n# -*- coding: UTF-8 -*-\n{command}\nEOF' + attach = 'INTERPRETER=python\ncommand -v python3 &> /dev/null && INTERPRETER=python3' + return f'{attach}\n$INTERPRETER << EOF\n# -*- coding: UTF-8 -*-\n{command}\nEOF' return command def send(self, data):