Mercurial > cpython-lru_cache-weakref
comparison Python/sysmodule.c @ 549:4efff6cea90f legacy-trunk
Raise SystemExit instead of calling goaway().
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 31 Dec 1991 13:15:35 +0000 |
| parents | bec963f99bc9 |
| children | e18f1fa398a3 |
comparison
equal
deleted
inserted
replaced
| 548:83046664160e | 549:4efff6cea90f |
|---|---|
| 94 static object * | 94 static object * |
| 95 sys_exit(self, args) | 95 sys_exit(self, args) |
| 96 object *self; | 96 object *self; |
| 97 object *args; | 97 object *args; |
| 98 { | 98 { |
| 99 int sts; | 99 /* Raise SystemExit so callers may catch it or clean up. */ |
| 100 if (!getintarg(args, &sts)) | 100 err_setval(SystemExit, args); |
| 101 return NULL; | 101 return NULL; |
| 102 goaway(sts); | |
| 103 exit(sts); /* Just in case */ | |
| 104 /* NOTREACHED */ | |
| 105 } | 102 } |
| 106 | 103 |
| 107 static struct methodlist sys_methods[] = { | 104 static struct methodlist sys_methods[] = { |
| 108 {"exit", sys_exit}, | 105 {"exit", sys_exit}, |
| 109 {NULL, NULL} /* sentinel */ | 106 {NULL, NULL} /* sentinel */ |
