Skip to content

Commit 294ee03

Browse files
committed
Fix: MP_QSTR_example changed to MP_QSTR_{mod.__name__}
1 parent 1cb2de7 commit 294ee03

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ustubby/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def stub_module(mod):
320320
# Set up the module properties
321321
stub_ret.append("")
322322
stub_ret.append(f"STATIC const mp_rom_map_elem_t {mod.__name__}_module_globals_table[] = {{")
323-
stub_ret.append(f"\t{{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_example) }},")
323+
stub_ret.append(f"\t{{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_{mod.__name__}) }},")
324324
stub_ret.extend(
325325
[f"\t{{ MP_ROM_QSTR(MP_QSTR_{f.__name__}), MP_ROM_PTR(&{mod.__name__}_{f.__name__}_obj) }}," for f in
326326
functions])
@@ -335,7 +335,7 @@ def stub_module(mod):
335335
# Register the module
336336
stub_ret.append("")
337337
stub_ret.append(
338-
f"MP_REGISTER_MODULE(MP_QSTR_example, {mod.__name__}_user_cmodule, MODULE_{mod.__name__.upper()}_ENABLED);")
338+
f"MP_REGISTER_MODULE(MP_QSTR_{mod.__name__}, {mod.__name__}_user_cmodule, MODULE_{mod.__name__.upper()}_ENABLED);")
339339
return "\n".join(stub_ret)
340340

341341

0 commit comments

Comments
 (0)