Mercurial > cpython-lru_cache-weakref
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 38488:48a6af87f3e8 | 38489:3fe3ccdf0155 |
|---|---|
| 198 | 198 |
| 199 static PyObject * | 199 static PyObject * |
| 200 sys_exit(PyObject *self, PyObject *args) | 200 sys_exit(PyObject *self, PyObject *args) |
| 201 { | 201 { |
| 202 PyObject *exit_code = 0; | 202 PyObject *exit_code = 0; |
| 203 if (!PyArg_ParseTuple(args, "|O:exit", &exit_code)) | 203 if (!PyArg_UnpackTuple(args, "exit", 0, 1, &exit_code)) |
| 204 return NULL; | 204 return NULL; |
| 205 /* Raise SystemExit so callers may catch it or clean up. */ | 205 /* Raise SystemExit so callers may catch it or clean up. */ |
| 206 PyErr_SetObject(PyExc_SystemExit, exit_code); | 206 PyErr_SetObject(PyExc_SystemExit, exit_code); |
| 207 return NULL; | 207 return NULL; |
| 208 } | 208 } |
| 670 | 670 |
| 671 static PyObject * | 671 static PyObject * |
| 672 sys_call_tracing(PyObject *self, PyObject *args) | 672 sys_call_tracing(PyObject *self, PyObject *args) |
| 673 { | 673 { |
| 674 PyObject *func, *funcargs; | 674 PyObject *func, *funcargs; |
| 675 if (!PyArg_ParseTuple(args, "OO:call_tracing", &func, &funcargs)) | 675 if (!PyArg_UnpackTuple(args, "call_tracing", 2, 2, &func, &funcargs)) |
| 676 return NULL; | 676 return NULL; |
| 677 return _PyEval_CallTracing(func, funcargs); | 677 return _PyEval_CallTracing(func, funcargs); |
| 678 } | 678 } |
| 679 | 679 |
| 680 PyDoc_STRVAR(callstats_doc, | 680 PyDoc_STRVAR(callstats_doc, |
