diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2018-12-21 14:20:55 +0300 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-01-31 16:48:30 +1100 |
commit | 2f5d113fad4ca2b22b084ccaf835c595cd6a7a4e (patch) | |
tree | 9d3eb975a624b96c0352ccbd715f0873b06a02db /ports/zephyr/modusocket.c | |
parent | 86f06d6a874d4eb3d6c50deec0240942344c01ea (diff) | |
download | micropython-2f5d113fad4ca2b22b084ccaf835c595cd6a7a4e.tar.gz micropython-2f5d113fad4ca2b22b084ccaf835c595cd6a7a4e.zip |
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 'ports/zephyr/modusocket.c')
-rw-r--r-- | ports/zephyr/modusocket.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ports/zephyr/modusocket.c b/ports/zephyr/modusocket.c index 84d6fa7297..083083788a 100644 --- a/ports/zephyr/modusocket.c +++ b/ports/zephyr/modusocket.c @@ -288,7 +288,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_recv_obj, socket_recv); STATIC mp_obj_t socket_setsockopt(size_t n_args, const mp_obj_t *args) { (void)n_args; // always 4 - mp_warning("setsockopt() not implemented"); + mp_warning(MP_WARN_CAT(RuntimeWarning), "setsockopt() not implemented"); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socket_setsockopt_obj, 4, 4, socket_setsockopt); |