comparison 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
comparison
equal deleted inserted replaced
546:937cbc0be6ec 547:e198cc98a4fd
286 void 286 void
287 print_error() 287 print_error()
288 { 288 {
289 object *exception, *v; 289 object *exception, *v;
290 err_get(&exception, &v); 290 err_get(&exception, &v);
291 if (exception == SystemExit) {
292 if (v == NULL || v == None)
293 goaway(0);
294 if (is_intobject(v))
295 goaway((int)getintvalue(v));
296 else {
297 printobject(v, stderr, PRINT_RAW);
298 fprintf(stderr, "\n");
299 goaway(1);
300 }
301 }
291 fprintf(stderr, "Unhandled exception: "); 302 fprintf(stderr, "Unhandled exception: ");
292 if (printobject(exception, stderr, PRINT_RAW) != 0) 303 if (printobject(exception, stderr, PRINT_RAW) != 0)
293 err_clear(); 304 err_clear();
294 if (v != NULL && v != None) { 305 if (v != NULL && v != None) {
295 fprintf(stderr, ": "); 306 fprintf(stderr, ": ");