aboutsummaryrefslogtreecommitdiff
path: root/ports/unix
diff options
context:
space:
mode:
authorPaul Sokolovsky2018-12-21 14:20:55 +0300
committerDamien George2019-01-31 16:48:30 +1100
commit2f5d113fad4ca2b22b084ccaf835c595cd6a7a4e (patch)
tree9d3eb975a624b96c0352ccbd715f0873b06a02db /ports/unix
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 'ports/unix')
-rw-r--r--ports/unix/mpconfigport_coverage.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/ports/unix/mpconfigport_coverage.h b/ports/unix/mpconfigport_coverage.h
index 2519482b0..87bf8454c 100644
--- a/ports/unix/mpconfigport_coverage.h
+++ b/ports/unix/mpconfigport_coverage.h
@@ -36,6 +36,7 @@
#define MICROPY_FLOAT_HIGH_QUALITY_HASH (1)
#define MICROPY_ENABLE_SCHEDULER (1)
#define MICROPY_READER_VFS (1)
+#define MICROPY_WARNINGS_CATEGORY (1)
#define MICROPY_MODULE_GETATTR (1)
#define MICROPY_PY_DELATTR_SETATTR (1)
#define MICROPY_PY_REVERSE_SPECIAL_METHODS (1)