diff Python/sysmodule.c @ 38489:3fe3ccdf0155 legacy-trunk

Make use of METH_O and METH_NOARGS where possible. Use Py_UnpackTuple instead of PyArg_ParseTuple where possible.
author Georg Brandl <georg@python.org>
date Mon, 29 May 2006 21:04:52 +0000
parents 61ac1e322da7
children 80a627340c9f
line wrap: on
line diff
--- a/Python/sysmodule.c	Mon May 29 20:57:01 2006 +0000
+++ b/Python/sysmodule.c	Mon May 29 21:04:52 2006 +0000
@@ -200,7 +200,7 @@
 sys_exit(PyObject *self, PyObject *args)
 {
 	PyObject *exit_code = 0;
-	if (!PyArg_ParseTuple(args, "|O:exit", &exit_code))
+	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);
@@ -672,7 +672,7 @@
 sys_call_tracing(PyObject *self, PyObject *args)
 {
 	PyObject *func, *funcargs;
-	if (!PyArg_ParseTuple(args, "OO:call_tracing", &func, &funcargs))
+	if (!PyArg_UnpackTuple(args, "call_tracing", 2, 2, &func, &funcargs))
 		return NULL;
 	return _PyEval_CallTracing(func, funcargs);
 }