mirror of
https://github.com/micropython/micropython.git
synced 2026-01-09 05:30:27 +01:00
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.
This commit is contained in:
committed by
Damien George
parent
86f06d6a87
commit
2f5d113fad
@@ -1454,7 +1454,7 @@ STATIC mp_obj_t lwip_getaddrinfo(size_t n_args, const mp_obj_t *args) {
|
||||
&& (type == 0 || type == MOD_NETWORK_SOCK_STREAM)
|
||||
&& proto == 0
|
||||
&& flags == 0)) {
|
||||
mp_warning("unsupported getaddrinfo constraints");
|
||||
mp_warning(MP_WARN_CAT(RuntimeWarning), "unsupported getaddrinfo constraints");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user