Skip to content

Commit 7cd54d7

Browse files
committed
Add ImportError.
1 parent 00c0b8a commit 7cd54d7

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

py/qstrdefs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Q(StopIteration)
3131

3232
Q(AssertionError)
3333
Q(AttributeError)
34+
Q(ImportError)
3435
Q(IndentationError)
3536
Q(IndexError)
3637
Q(KeyError)

py/runtime.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ void rt_init(void) {
9292

9393
// built-in exceptions (TODO, make these proper classes, and const if possible)
9494
mp_map_add_qstr(&map_builtins, MP_QSTR_AttributeError, mp_obj_new_exception(MP_QSTR_AttributeError));
95+
mp_map_add_qstr(&map_builtins, MP_QSTR_ImportError, mp_obj_new_exception(MP_QSTR_ImportError));
9596
mp_map_add_qstr(&map_builtins, MP_QSTR_IndexError, mp_obj_new_exception(MP_QSTR_IndexError));
9697
mp_map_add_qstr(&map_builtins, MP_QSTR_KeyError, mp_obj_new_exception(MP_QSTR_KeyError));
9798
mp_map_add_qstr(&map_builtins, MP_QSTR_NameError, mp_obj_new_exception(MP_QSTR_NameError));

0 commit comments

Comments
 (0)