mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
...
This commit is contained in:
parent
ec30ba9d02
commit
1bbba50003
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user