summaryrefslogtreecommitdiffstatshomepage
path: root/py/objexcept.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-02-23 23:18:36 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-02-23 23:20:16 +0200
commit71ebd4b7f0b88fc0ceb36d8c2464a5114470f5a0 (patch)
tree5dbe2286da42eea430459f1d3d373ca99386ec21 /py/objexcept.c
parent70b31608719e77b810017619ef41ef0783126483 (diff)
downloadmicropython-71ebd4b7f0b88fc0ceb36d8c2464a5114470f5a0.tar.gz
micropython-71ebd4b7f0b88fc0ceb36d8c2464a5114470f5a0.zip
py: Implement UnicodeError.
Still too shy to implement UnicodeEncodeError which was really needed for micropython-lib case.
Diffstat (limited to 'py/objexcept.c')
-rw-r--r--py/objexcept.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/py/objexcept.c b/py/objexcept.c
index 858804d0b7..824c9b0ad7 100644
--- a/py/objexcept.c
+++ b/py/objexcept.c
@@ -249,7 +249,11 @@ MP_DEFINE_EXCEPTION(Exception, BaseException)
//MP_DEFINE_EXCEPTION(SystemError, Exception)
MP_DEFINE_EXCEPTION(TypeError, Exception)
MP_DEFINE_EXCEPTION(ValueError, Exception)
- //TODO: Implement UnicodeErrors which take arguments
+#if MICROPY_PY_BUILTINS_STR_UNICODE
+ MP_DEFINE_EXCEPTION_BASE(ValueError)
+ MP_DEFINE_EXCEPTION(UnicodeError, ValueError)
+ //TODO: Implement more UnicodeError subclasses which take arguments
+#endif
/*
MP_DEFINE_EXCEPTION(Warning, Exception)
MP_DEFINE_EXCEPTION_BASE(Warning)