summaryrefslogtreecommitdiff
path: root/py/runtime.h
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-06-07 23:22:41 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-06-07 23:26:27 +0300
commit7e4a2b0edca2953ae3dd19f9ad554739a9174c81 (patch)
treec5a0a0faa0000789edc76dc411ca2914b80d8877 /py/runtime.h
parentaabd83ea204325cdf45355a5bdc6838745484060 (diff)
py: Add generic mp_not_implemented() func to use instead of assert().
Benefits: won't crash baremetal targets, will provide Python source location when not implemented feature used (it will no longer provide C source location, but just grep for error message).
Diffstat (limited to 'py/runtime.h')
-rw-r--r--py/runtime.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/py/runtime.h b/py/runtime.h
index dbd413180..fb61c01dd 100644
--- a/py/runtime.h
+++ b/py/runtime.h
@@ -112,6 +112,9 @@ mp_obj_t mp_import_name(qstr name, mp_obj_t fromlist, mp_obj_t level);
mp_obj_t mp_import_from(mp_obj_t module, qstr name);
void mp_import_all(mp_obj_t module);
+// Raise NotImplementedError with given message
+NORETURN void mp_not_implemented(const char *msg);
+
extern struct _mp_obj_list_t mp_sys_path_obj;
extern struct _mp_obj_list_t mp_sys_argv_obj;
#define mp_sys_path ((mp_obj_t)&mp_sys_path_obj)