Skip to content

Commit d114eb1

Browse files
committed
Merge branch 'add-os-module' of https://github.com/glaukiol1/gpython into add-os-module
2 parents 93c97ba + d0f1269 commit d114eb1

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

py/util.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -222,16 +222,12 @@ func Println(self Object, args ...string) error {
222222
return AssertionError
223223
}
224224
for _, v := range args {
225-
if strings.Contains(v, "\n") {
226-
_, err = Call(write, Tuple{String(v)}, nil) // do not write a space
227-
if err != nil {
228-
return 1, err
229-
}
230-
} else {
231-
_, err = Call(write, Tuple{String(v + " ")}, nil)
232-
if err != nil {
233-
return 1, err
234-
}
225+
if !strings.Contains(v, "\n") {
226+
v += " "
227+
}
228+
_, err := call(Tuple{String(v)}, nil)
229+
if err != nil {
230+
return err
235231
}
236232

237233
}

0 commit comments

Comments
 (0)