BLUELOVETH 2 years ago
parent
commit
04c9cb8544
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/pocketpy.cpp

+ 2 - 0
src/pocketpy.cpp

@@ -173,7 +173,9 @@ void init_builtins(VM* _vm) {
                 if(!entry){
                 if(!entry){
                     vm->_error("ImportError", "cannot load dynamic library: " + name.escape());
                     vm->_error("ImportError", "cannot load dynamic library: " + name.escape());
                 }
                 }
+                vm->_c.s_view.push(ArgsView(vm->s_data.end(), vm->s_data.end()));
                 const char* name = entry(vm, PK_VERSION);
                 const char* name = entry(vm, PK_VERSION);
+                vm->_c.s_view.pop();
                 if(name == nullptr){
                 if(name == nullptr){
                     vm->_error("ImportError", "module initialization failed: " + Str(name).escape());
                     vm->_error("ImportError", "module initialization failed: " + Str(name).escape());
                 }
                 }