From 7cd54d79db8abd4bd5c3a964f8096de4f7734b23 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Tue, 4 Feb 2014 03:33:55 +0200 Subject: [PATCH] Add ImportError. --- py/qstrdefs.h | 1 + py/runtime.c | 1 + 2 files changed, 2 insertions(+) diff --git a/py/qstrdefs.h b/py/qstrdefs.h index b246c5b427..7efa85b8a5 100644 --- a/py/qstrdefs.h +++ b/py/qstrdefs.h @@ -31,6 +31,7 @@ Q(StopIteration) Q(AssertionError) Q(AttributeError) +Q(ImportError) Q(IndentationError) Q(IndexError) Q(KeyError) diff --git a/py/runtime.c b/py/runtime.c index 74c55ea6cb..0f27273273 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -92,6 +92,7 @@ void rt_init(void) { // built-in exceptions (TODO, make these proper classes, and const if possible) mp_map_add_qstr(&map_builtins, MP_QSTR_AttributeError, mp_obj_new_exception(MP_QSTR_AttributeError)); + mp_map_add_qstr(&map_builtins, MP_QSTR_ImportError, mp_obj_new_exception(MP_QSTR_ImportError)); mp_map_add_qstr(&map_builtins, MP_QSTR_IndexError, mp_obj_new_exception(MP_QSTR_IndexError)); mp_map_add_qstr(&map_builtins, MP_QSTR_KeyError, mp_obj_new_exception(MP_QSTR_KeyError)); mp_map_add_qstr(&map_builtins, MP_QSTR_NameError, mp_obj_new_exception(MP_QSTR_NameError));