[Python-checkins] CVS: python/dist/src/Python sysmodule.c,2.93,2.94

Fred L. Drake fdrake@users.sourceforge.net
2001年10月24日 13:47:51 -0700


Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv20824
Modified Files:
	sysmodule.c 
Log Message:
Convert getrefcount() to METH_O, and sys_excepthook() to use
PyArg_UnpackTuple().
Index: sysmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/sysmodule.c,v
retrieving revision 2.93
retrieving revision 2.94
diff -C2 -d -r2.93 -r2.94
*** sysmodule.c	2001年10月04日 14:48:42	2.93
--- sysmodule.c	2001年10月24日 20:47:48	2.94
***************
*** 117,121 ****
 {
 	PyObject *exc, *value, *tb;
! 	if (!PyArg_ParseTuple(args, "OOO:excepthook", &exc, &value, &tb))
 		return NULL;
 	PyErr_Display(exc, value, tb);
--- 117,121 ----
 {
 	PyObject *exc, *value, *tb;
! 	if (!PyArg_UnpackTuple(args, "excepthook", 3, 3, &exc, &value, &tb))
 		return NULL;
 	PyErr_Display(exc, value, tb);
***************
*** 453,461 ****
 
 static PyObject *
! sys_getrefcount(PyObject *self, PyObject *args)
 {
- 	PyObject *arg;
- 	if (!PyArg_ParseTuple(args, "O:getrefcount", &arg))
- 		return NULL;
 	return PyInt_FromLong(arg->ob_refcnt);
 }
--- 453,458 ----
 
 static PyObject *
! sys_getrefcount(PyObject *self, PyObject *arg)
 {
 	return PyInt_FromLong(arg->ob_refcnt);
 }
***************
*** 555,559 ****
 	{"gettotalrefcount", (PyCFunction)sys_gettotalrefcount, METH_NOARGS},
 #endif
! 	{"getrefcount",	sys_getrefcount, METH_VARARGS, getrefcount_doc},
 	{"getrecursionlimit", (PyCFunction)sys_getrecursionlimit, METH_NOARGS,
 	 getrecursionlimit_doc},
--- 552,556 ----
 	{"gettotalrefcount", (PyCFunction)sys_gettotalrefcount, METH_NOARGS},
 #endif
! 	{"getrefcount",	(PyCFunction)sys_getrefcount, METH_O, getrefcount_doc},
 	{"getrecursionlimit", (PyCFunction)sys_getrecursionlimit, METH_NOARGS,
 	 getrecursionlimit_doc},

AltStyle によって変換されたページ (->オリジナル) /