Skip to content

Instantly share code, notes, and snippets.

@llimllib
Created February 4, 2010 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save llimllib/294962 to your computer and use it in GitHub Desktop.
Save llimllib/294962 to your computer and use it in GitHub Desktop.
static PyObject *
sys_exit(PyObject *self, PyObject *args)
{
PyObject *exit_code = 0;
if (!PyArg_UnpackTuple(args, "exit", 0, 1, &exit_code))
return NULL;
/* Raise SystemExit so callers may catch it or clean up. */
PyErr_SetObject(PyExc_SystemExit, exit_code);
return NULL;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment