This commit is contained in:
blueloveTH 2024-07-30 12:15:50 +08:00
parent ec30ba9d02
commit 1bbba50003
2 changed files with 1 additions and 11 deletions

View File

@ -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;

View File

@ -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;