summaryrefslogtreecommitdiff
path: root/py/vm.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2018-12-21 14:20:55 +0300
committerDamien George <damien.p.george@gmail.com>2019-01-31 16:48:30 +1100
commit2f5d113fad4ca2b22b084ccaf835c595cd6a7a4e (patch)
tree9d3eb975a624b96c0352ccbd715f0873b06a02db /py/vm.c
parent86f06d6a874d4eb3d6c50deec0240942344c01ea (diff)
py/warning: Support categories for warnings.
Python defines warnings as belonging to categories, where category is a warning type (descending from exception type). This is useful, as e.g. allows to disable warnings selectively and provide user-defined warning types. So, implement this in MicroPython, except that categories are represented just with strings. However, enough hooks are left to implement categories differently per-port (e.g. as types), without need to patch each and every usage.
Diffstat (limited to 'py/vm.c')
-rw-r--r--py/vm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/vm.c b/py/vm.c
index f9f9a3d6a..fce59349f 100644
--- a/py/vm.c
+++ b/py/vm.c
@@ -1116,7 +1116,7 @@ unwind_return:
mp_uint_t unum = *ip;
mp_obj_t obj;
if (unum == 2) {
- mp_warning("exception chaining not supported");
+ mp_warning(NULL, "exception chaining not supported");
// ignore (pop) "from" argument
sp--;
}