summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-10-24 20:47:48 (GMT)
committerFred Drake <fdrake@acm.org>2001-10-24 20:47:48 (GMT)
commita768882b0000852539a312c939d69ab9f08f62ae (patch)
tree9e673255b91312c718230c4dbadc4d084b77fcda /Python/sysmodule.c
parente2ae77b8b8a62e648bb1864a9b36ef3280984404 (diff)
downloadcpython-a768882b0000852539a312c939d69ab9f08f62ae.zip
cpython-a768882b0000852539a312c939d69ab9f08f62ae.tar.gz
cpython-a768882b0000852539a312c939d69ab9f08f62ae.tar.bz2
Convert getrefcount() to METH_O, and sys_excepthook() to use
PyArg_UnpackTuple().
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index deead3a..711cd49 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -116,7 +116,7 @@ static PyObject *
sys_excepthook(PyObject* self, PyObject* args)
{
PyObject *exc, *value, *tb;
- if (!PyArg_ParseTuple(args, "OOO:excepthook", &exc, &value, &tb))
+ if (!PyArg_UnpackTuple(args, "excepthook", 3, 3, &exc, &value, &tb))
return NULL;
PyErr_Display(exc, value, tb);
Py_INCREF(Py_None);
@@ -452,11 +452,8 @@ sys_mdebug(PyObject *self, PyObject *args)
#endif /* USE_MALLOPT */
static PyObject *
-sys_getrefcount(PyObject *self, PyObject *args)
+sys_getrefcount(PyObject *self, PyObject *arg)
{
- PyObject *arg;
- if (!PyArg_ParseTuple(args, "O:getrefcount", &arg))
- return NULL;
return PyInt_FromLong(arg->ob_refcnt);
}
@@ -554,7 +551,7 @@ static PyMethodDef sys_methods[] = {
{"getobjects", _Py_GetObjects, METH_VARARGS},
{"gettotalrefcount", (PyCFunction)sys_gettotalrefcount, METH_NOARGS},
#endif
- {"getrefcount", sys_getrefcount, METH_VARARGS, getrefcount_doc},
+ {"getrefcount", (PyCFunction)sys_getrefcount, METH_O, getrefcount_doc},
{"getrecursionlimit", (PyCFunction)sys_getrecursionlimit, METH_NOARGS,
getrecursionlimit_doc},
{"_getframe", sys_getframe, METH_VARARGS, getframe_doc},