Mercurial > cpython-lru_cache-weakref
diff Python/pythonmain.c @ 547:e198cc98a4fd legacy-trunk
Catch SystemExit and go away if it is caught.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 31 Dec 1991 13:14:48 +0000 |
| parents | 85bd7dac13f3 |
| children | 0614d887d10a |
line wrap: on
line diff
--- a/Python/pythonmain.c Tue Dec 31 13:14:13 1991 +0000 +++ b/Python/pythonmain.c Tue Dec 31 13:14:48 1991 +0000 @@ -288,6 +288,17 @@ { object *exception, *v; err_get(&exception, &v); + if (exception == SystemExit) { + if (v == NULL || v == None) + goaway(0); + if (is_intobject(v)) + goaway((int)getintvalue(v)); + else { + printobject(v, stderr, PRINT_RAW); + fprintf(stderr, "\n"); + goaway(1); + } + } fprintf(stderr, "Unhandled exception: "); if (printobject(exception, stderr, PRINT_RAW) != 0) err_clear();
