From e82e33b678e76753892ce2fedc0265f1344b62e8 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Mon, 6 Feb 2023 17:30:37 +0800 Subject: [PATCH] Update pocketpy.h --- src/pocketpy.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pocketpy.h b/src/pocketpy.h index 0c461ebb..801d0eeb 100644 --- a/src/pocketpy.h +++ b/src/pocketpy.h @@ -213,7 +213,7 @@ void __initializeBuiltinFunctions(VM* _vm) { }); _vm->bindMethod<0>("int", "__json__", [](VM* vm, const pkpy::Args& args) { - return vm->PyStr(std::to_string((int)vm->PyInt_AS_C(args[0]))); + return vm->PyStr(std::to_string(vm->PyInt_AS_C(args[0]))); }); #define __INT_BITWISE_OP(name,op) \ @@ -829,7 +829,8 @@ extern "C" { ss << f_header << ' '; for(int i=0; icall(args[i], __json__); - ss << vm->PyStr_AS_C(x) << ' '; + ss << vm->PyStr_AS_C(x); + if(i != args.size() - 1) ss << ' '; } switch(ret_code){ case 'i': return vm->PyInt(f_int(ss.str().c_str()));