1.1 --- a/generator.py Thu Jan 12 18:03:49 2017 +0100
1.2 +++ b/generator.py Thu Jan 12 18:04:32 2017 +0100
1.3 @@ -1115,6 +1115,11 @@
1.4 }
1.5 __Catch(__tmp_exc)
1.6 {
1.7 + if (__ISINSTANCE(__tmp_exc.arg, ((__attr) {0, &__builtins___exception_system_SystemExit})))
1.8 + return __load_via_object(
1.9 + __load_via_object(__tmp_exc.arg.value, %s).value,
1.10 + %s).intvalue;
1.11 +
1.12 fprintf(stderr, "Program terminated due to exception: %%s.\\n",
1.13 __load_via_object(
1.14 %s((__attr[]) {{0, 0}, __tmp_exc.arg}).value,
1.15 @@ -1123,6 +1128,8 @@
1.16 }
1.17 }
1.18 """ % (
1.19 + encode_symbol("pos", "value"),
1.20 + encode_symbol("pos", "__data__"),
1.21 encode_function_pointer("__builtins__.str.str"),
1.22 encode_symbol("pos", "__data__")
1.23 )
2.1 --- a/lib/__builtins__/exception/system.py Thu Jan 12 18:03:49 2017 +0100
2.2 +++ b/lib/__builtins__/exception/system.py Thu Jan 12 18:04:32 2017 +0100
2.3 @@ -40,6 +40,12 @@
2.4 class RuntimeError(Exception): pass
2.5 class RuntimeWarning(Warning): pass
2.6 class SystemError(Exception): pass
2.7 -class SystemExit(Exception): pass
2.8 +
2.9 +class SystemExit(Exception):
2.10 +
2.11 + "An exception exiting the program."
2.12 +
2.13 + def __init__(self, value):
2.14 + self.value = value
2.15
2.16 # vim: tabstop=4 expandtab shiftwidth=4