According to Python/sysmodule.c , raising SystemExit is all it does.
static PyObject * sys_exit(PyObject *self, PyObject *args) { PyObject *exit_code = 0; if (!PyArg_UnpackTuple(args, "exit", 0, 1, &exit_code)) return NULL; PyErr_SetObject(PyExc_SystemExit, exit_code); return NULL; }
source share