We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 07fb84a commit 6e7cf6cCopy full SHA for 6e7cf6c
1 file changed
internal/runtime/langs.go
@@ -3,6 +3,7 @@ package runtime
3
import (
4
"fmt"
5
"github.com/docker/docker/api/types/mount"
6
+ "strings"
7
)
8
9
type containerContext struct {
@@ -72,6 +73,11 @@ try {
72
73
}
74
75
func createPyContext(code string) *containerContext {
76
+ codeLines := []string{}
77
+ for _, line := range strings.Split(code, "\n") {
78
+ codeLines = append(codeLines, fmt.Sprintf(" %s", line))
79
+ }
80
+
81
wrapperFile := "wrapper.py"
82
cmd := []string{"python", "/code/wrapper.py"}
83
containerImage := "python:3.12-alpine"
@@ -91,7 +97,7 @@ try:
91
97
exec(code)
92
98
except Exception as e:
93
99
print(json.dumps({'error': str(e)}))
94
-`, code,
100
+`, strings.Join(codeLines, "\n"),
95
101
96
102
103
mounts := []mount.Mount{
0 commit comments