From 71ebd4b7f0b88fc0ceb36d8c2464a5114470f5a0 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Mon, 23 Feb 2015 23:18:36 +0200 Subject: py: Implement UnicodeError. Still too shy to implement UnicodeEncodeError which was really needed for micropython-lib case. --- py/objexcept.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'py/objexcept.c') 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) -- cgit v1.2.3