py: Implement UnicodeError.

Still too shy to implement UnicodeEncodeError which was really needed for
micropython-lib case.
This commit is contained in:
Paul Sokolovsky
2015-02-23 23:18:36 +02:00
parent 70b3160871
commit 71ebd4b7f0
4 changed files with 12 additions and 1 deletions

View File

@@ -683,6 +683,9 @@ STATIC const mp_map_elem_t mp_module_builtins_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_SyntaxError), (mp_obj_t)&mp_type_SyntaxError },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SystemExit), (mp_obj_t)&mp_type_SystemExit },
{ MP_OBJ_NEW_QSTR(MP_QSTR_TypeError), (mp_obj_t)&mp_type_TypeError },
#if MICROPY_PY_BUILTINS_STR_UNICODE
{ MP_OBJ_NEW_QSTR(MP_QSTR_UnicodeError), (mp_obj_t)&mp_type_UnicodeError },
#endif
{ MP_OBJ_NEW_QSTR(MP_QSTR_ValueError), (mp_obj_t)&mp_type_ValueError },
{ MP_OBJ_NEW_QSTR(MP_QSTR_ZeroDivisionError), (mp_obj_t)&mp_type_ZeroDivisionError },
// Somehow CPython managed to have OverflowError not inherit from ValueError ;-/