summaryrefslogtreecommitdiffstatshomepage
path: root/py/builtintables.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-10-12 11:46:04 +0100
committerDamien George <damien.p.george@gmail.com>2014-10-12 20:18:40 +0100
commitc14a81662c1df812c0c6b4299f97966302f16477 (patch)
tree68d9169d0ddaf4de9c531ca1212fad6b805bf42b /py/builtintables.h
parent3c34d4140df74d59e56ccd0465408fecf8876c88 (diff)
downloadmicropython-c14a81662c1df812c0c6b4299f97966302f16477.tar.gz
micropython-c14a81662c1df812c0c6b4299f97966302f16477.zip
py: Add module weak link support.
With this patch a port can enable module weak link support and provide a dict of qstr->module mapping. This mapping is looked up only if an import fails to find the requested module in the filesystem. This allows to have the builtin module named, eg, usocket, and provide a weak link of "socket" to the same module, but this weak link can be overridden if a file by the name "socket.py" is found in the import path.
Diffstat (limited to 'py/builtintables.h')
-rw-r--r--py/builtintables.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/py/builtintables.h b/py/builtintables.h
index 96fc813aba..5a865a78b4 100644
--- a/py/builtintables.h
+++ b/py/builtintables.h
@@ -26,3 +26,7 @@
extern const mp_obj_dict_t mp_builtin_object_dict_obj;
extern const mp_obj_dict_t mp_builtin_module_dict_obj;
+
+#if MICROPY_MODULE_WEAK_LINKS
+extern const mp_obj_dict_t mp_builtin_module_weak_links_dict_obj;
+#endif