From cc94a382a9c82cf6b9c798cc78fdb49da4f7682a Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Tue, 20 Aug 2024 17:13:09 +0800 Subject: [PATCH] ... --- src/public/modules.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/public/modules.c b/src/public/modules.c index 72306107..a9b1a07c 100644 --- a/src/public/modules.c +++ b/src/public/modules.c @@ -437,6 +437,10 @@ static bool builtins_locals(int argc, py_Ref argv) { void py_newglobals(py_Ref out) { Frame* frame = pk_current_vm->top_frame; + if(!frame){ + pk_mappingproxy__namedict(out, &pk_current_vm->main); + return; + } if(frame->is_dynamic) { py_assign(out, &frame->p0[0]); } else {