Skip to content

Commit 277332c

Browse files
committed
builtin_print - separate multiple arguments with spaces.
1 parent e6f0618 commit 277332c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

vm/src/builtins.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,13 @@ fn builtin_pow(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
466466

467467
pub fn builtin_print(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
468468
trace!("print called with {:?}", args);
469+
let mut first = true;
469470
for a in args.args {
471+
if first {
472+
first = false;
473+
} else {
474+
print!(" ");
475+
}
470476
let v = vm.to_str(&a)?;
471477
let s = objstr::get_value(&v);
472478
print!("{}", s);

0 commit comments

Comments
 (0)