Catch SystemExit and go away if it is caught.

This commit is contained in:
Guido van Rossum 1991-12-31 13:14:48 +00:00
parent afbb8db8e6
commit a534ed3ee7
1 changed files with 11 additions and 0 deletions

View File

@ -288,6 +288,17 @@ print_error()
{
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();