summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-05-24 23:32:19 +0100
committerDamien George <damien.p.george@gmail.com>2014-05-24 23:32:19 +0100
commit7a4ddd24281a7e21eeaa697644418015cf4dd650 (patch)
tree6e1e87da8bee4f94539b98625b4deb6fd9ececd4 /py
parentee3fd46f1383e984c968c4a82d634d7b0cea49b8 (diff)
downloadmicropython-7a4ddd24281a7e21eeaa697644418015cf4dd650.tar.gz
micropython-7a4ddd24281a7e21eeaa697644418015cf4dd650.zip
Add SystemExit exception and use it in unix/ and stmhal/ ports.
Addresses issue #598.
Diffstat (limited to 'py')
-rw-r--r--py/obj.h1
-rw-r--r--py/objexcept.c2
-rw-r--r--py/qstrdefs.h1
3 files changed, 3 insertions, 1 deletions
diff --git a/py/obj.h b/py/obj.h
index 2df597de75..2a9ed3acd3 100644
--- a/py/obj.h
+++ b/py/obj.h
@@ -344,6 +344,7 @@ extern const mp_obj_type_t mp_type_RuntimeError;
extern const mp_obj_type_t mp_type_StopIteration;
extern const mp_obj_type_t mp_type_SyntaxError;
extern const mp_obj_type_t mp_type_SystemError;
+extern const mp_obj_type_t mp_type_SystemExit;
extern const mp_obj_type_t mp_type_TypeError;
extern const mp_obj_type_t mp_type_ValueError;
extern const mp_obj_type_t mp_type_ZeroDivisionError;
diff --git a/py/objexcept.c b/py/objexcept.c
index 0006554a85..7583d07431 100644
--- a/py/objexcept.c
+++ b/py/objexcept.c
@@ -159,7 +159,7 @@ const mp_obj_type_t mp_type_ ## exc_name = { \
// List of all exceptions, arranged as in the table at:
// http://docs.python.org/3.3/library/exceptions.html
MP_DEFINE_EXCEPTION_BASE(BaseException)
-//MP_DEFINE_EXCEPTION(SystemExit, BaseException)
+MP_DEFINE_EXCEPTION(SystemExit, BaseException)
//MP_DEFINE_EXCEPTION(KeyboardInterrupt, BaseException)
MP_DEFINE_EXCEPTION(GeneratorExit, BaseException)
MP_DEFINE_EXCEPTION(Exception, BaseException)
diff --git a/py/qstrdefs.h b/py/qstrdefs.h
index 1de0989190..2d4ddfea29 100644
--- a/py/qstrdefs.h
+++ b/py/qstrdefs.h
@@ -102,6 +102,7 @@ Q(OverflowError)
Q(RuntimeError)
Q(SyntaxError)
Q(SystemError)
+Q(SystemExit)
Q(TypeError)
Q(UnboundLocalError)
Q(ValueError)