summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Python/sysmodule.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index ef93d20..c846068 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -96,12 +96,9 @@ sys_exit(self, args)
object *self;
object *args;
{
- int sts;
- if (!getintarg(args, &sts))
- return NULL;
- goaway(sts);
- exit(sts); /* Just in case */
- /* NOTREACHED */
+ /* Raise SystemExit so callers may catch it or clean up. */
+ err_setval(SystemExit, args);
+ return NULL;
}
static struct methodlist sys_methods[] = {