]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Catch SystemExit and go away if it is caught.
authorGuido van Rossum <guido@python.org>
Tue, 31 Dec 1991 13:14:48 +0000 (13:14 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 31 Dec 1991 13:14:48 +0000 (13:14 +0000)
Python/pythonmain.c

index 9fa1a588dbe1dfe1d22ba035a0d53a3790961706..0e47c9a3d60946e113da3e90e72d4db2bf8cdce8 100644 (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();