mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-26 06:20:16 +00:00
...
This commit is contained in:
parent
e7f947c987
commit
92638781ad
@ -1606,12 +1606,7 @@ void VM::post_init(){
|
|||||||
|
|
||||||
_all_types[tp_module].m__getattr__ = [](VM* vm, PyObject* obj, StrName name) -> PyObject*{
|
_all_types[tp_module].m__getattr__ = [](VM* vm, PyObject* obj, StrName name) -> PyObject*{
|
||||||
const Str& path = CAST(Str&, obj->attr(__path__));
|
const Str& path = CAST(Str&, obj->attr(__path__));
|
||||||
PyObject* mod = vm->py_import(fmt(path, ".", name.sv()), false);
|
return vm->py_import(fmt(path, ".", name.sv()), false);
|
||||||
if(mod != nullptr){
|
|
||||||
obj->attr().set(name, mod);
|
|
||||||
return mod;
|
|
||||||
}
|
|
||||||
return nullptr;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bind_method<1>(tp_property, "setter", [](VM* vm, ArgsView args) {
|
bind_method<1>(tp_property, "setter", [](VM* vm, ArgsView args) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user