From 1bbba500030299d4d42407321dd7878acc4413a0 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Tue, 30 Jul 2024 12:15:50 +0800 Subject: [PATCH] ... --- include/pocketpy/interpreter/vm.h | 1 - src/interpreter/vm.c | 11 +---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/include/pocketpy/interpreter/vm.h b/include/pocketpy/interpreter/vm.h index 3a01e6ff..e73d7f73 100644 --- a/include/pocketpy/interpreter/vm.h +++ b/include/pocketpy/interpreter/vm.h @@ -41,7 +41,6 @@ typedef struct pk_VM { void (*_ceval_on_step)(Frame*, Bytecode); unsigned char* (*_import_file)(const char*); void (*_stdout)(const char*, ...); - void (*_stderr)(const char*, ...); py_TValue last_retval; py_TValue curr_exception; diff --git a/src/interpreter/vm.c b/src/interpreter/vm.c index 654db5a0..e7496cdf 100644 --- a/src/interpreter/vm.c +++ b/src/interpreter/vm.c @@ -14,19 +14,11 @@ static unsigned char* pk_default_import_file(const char* path) { return NULL; } static void pk_default_stdout(const char* fmt, ...) { va_list args; va_start(args, fmt); - vfprintf(stdout, fmt, args); + vprintf(fmt, args); va_end(args); fflush(stdout); } -static void pk_default_stderr(const char* fmt, ...) { - va_list args; - va_start(args, fmt); - vfprintf(stderr, fmt, args); - va_end(args); - fflush(stderr); -} - static void pk_TypeInfo__ctor(pk_TypeInfo* self, py_Name name, py_Type index, @@ -65,7 +57,6 @@ void pk_VM__ctor(pk_VM* self) { self->_ceval_on_step = NULL; self->_import_file = pk_default_import_file; self->_stdout = pk_default_stdout; - self->_stderr = pk_default_stderr; self->last_retval = *py_NIL; self->curr_exception = *py_NIL;