diff --git a/include/pocketpy/vm.h b/include/pocketpy/vm.h index 9633b8b9..a08933fa 100644 --- a/include/pocketpy/vm.h +++ b/include/pocketpy/vm.h @@ -356,7 +356,7 @@ public: #endif #if PK_REGION("General Bindings") - PyObject* bind_func(PyObject*obj, StrName name, int argc, NativeFuncC fn, any userdata={}, BindType bt=BindType::DEFAULT); + PyObject* bind_func(PyObject* obj, StrName name, int argc, NativeFuncC fn, any userdata={}, BindType bt=BindType::DEFAULT); PyObject* bind_func(Type type, StrName name, int argc, NativeFuncC fn, any userdata={}, BindType bt=BindType::DEFAULT){ return bind_func(_t(type), name, argc, fn, std::move(userdata), bt); } diff --git a/src/io.cpp b/src/io.cpp index 4baaaa3c..a5e749e4 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -154,7 +154,7 @@ void add_module_io(VM* vm){ void add_module_os(VM* vm){ PyObject* mod = vm->new_module("os"); - PyVar path_obj = vm->new_object(vm->tp_object); + PyObject* path_obj = vm->heap.gcnew(VM::tp_object); mod->attr().set("path", path_obj); // Working directory is shared by all VMs!!