From 7a4ddd24281a7e21eeaa697644418015cf4dd650 Mon Sep 17 00:00:00 2001 From: Damien George Date: Sat, 24 May 2014 23:32:19 +0100 Subject: Add SystemExit exception and use it in unix/ and stmhal/ ports. Addresses issue #598. --- py/obj.h | 1 + py/objexcept.c | 2 +- py/qstrdefs.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) (limited to 'py') diff --git a/py/obj.h b/py/obj.h index 2df597de7..2a9ed3acd 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 0006554a8..7583d0743 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 1de098919..2d4ddfea2 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) -- cgit v1.2.3