This commit is contained in:
blueloveTH 2024-06-02 23:00:50 +08:00
parent 663ca1ccf0
commit 2b50aad4ef

View File

@ -1557,7 +1557,9 @@ void VM::__post_init_builtin_types(){
_all_types[tp_module].m__getattr__ = [](VM* vm, PyVar obj, StrName name) -> PyVar{ _all_types[tp_module].m__getattr__ = [](VM* vm, PyVar obj, StrName name) -> PyVar{
const Str& path = CAST(Str&, obj->attr(__path__)); const Str& path = CAST(Str&, obj->attr(__path__));
return vm->py_import(_S(path, ".", name.sv()), false); PyObject* retval = vm->py_import(_S(path, ".", name.sv()), false);
if(retval) return retval;
return nullptr;
}; };
bind_func(tp_property, "setter", 2, [](VM* vm, ArgsView args) { bind_func(tp_property, "setter", 2, [](VM* vm, ArgsView args) {