mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	Use modern PyArg_ParseTuple style, with function names.
(Mostly.)
This commit is contained in:
		
							parent
							
								
									2efa369861
								
							
						
					
					
						commit
						ffc0f4fb36
					
				
					 1 changed files with 8 additions and 8 deletions
				
			
		| 
						 | 
					@ -106,7 +106,7 @@ sys_exc_info(self, args)
 | 
				
			||||||
	PyObject *args;
 | 
						PyObject *args;
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	PyThreadState *tstate;
 | 
						PyThreadState *tstate;
 | 
				
			||||||
	if (!PyArg_Parse(args, ""))
 | 
						if (!PyArg_ParseTuple(args, ":exc_info"))
 | 
				
			||||||
		return NULL;
 | 
							return NULL;
 | 
				
			||||||
	tstate = PyThreadState_Get();
 | 
						tstate = PyThreadState_Get();
 | 
				
			||||||
	return Py_BuildValue(
 | 
						return Py_BuildValue(
 | 
				
			||||||
| 
						 | 
					@ -214,7 +214,7 @@ sys_mdebug(self, args)
 | 
				
			||||||
	PyObject *args;
 | 
						PyObject *args;
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int flag;
 | 
						int flag;
 | 
				
			||||||
	if (!PyArg_Parse(args, "i", &flag))
 | 
						if (!PyArg_ParseTuple(args, "i:mdebug", &flag))
 | 
				
			||||||
		return NULL;
 | 
							return NULL;
 | 
				
			||||||
	mallopt(M_DEBUG, flag);
 | 
						mallopt(M_DEBUG, flag);
 | 
				
			||||||
	Py_INCREF(Py_None);
 | 
						Py_INCREF(Py_None);
 | 
				
			||||||
| 
						 | 
					@ -228,7 +228,7 @@ sys_getrefcount(self, args)
 | 
				
			||||||
	PyObject *args;
 | 
						PyObject *args;
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	PyObject *arg;
 | 
						PyObject *arg;
 | 
				
			||||||
	if (!PyArg_Parse(args, "O", &arg))
 | 
						if (!PyArg_ParseTuple(args, "O:getrefcount", &arg))
 | 
				
			||||||
		return NULL;
 | 
							return NULL;
 | 
				
			||||||
	return PyInt_FromLong((long) arg->ob_refcnt);
 | 
						return PyInt_FromLong((long) arg->ob_refcnt);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -246,7 +246,7 @@ sys_getcounts(self, args)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	extern PyObject *get_counts Py_PROTO((void));
 | 
						extern PyObject *get_counts Py_PROTO((void));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!PyArg_Parse(args, ""))
 | 
						if (!PyArg_ParseTuple(args, ":getcounts"))
 | 
				
			||||||
		return NULL;
 | 
							return NULL;
 | 
				
			||||||
	return get_counts();
 | 
						return get_counts();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -264,10 +264,10 @@ extern PyObject *_Py_GetDXProfile Py_PROTO((PyObject *,  PyObject *));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static PyMethodDef sys_methods[] = {
 | 
					static PyMethodDef sys_methods[] = {
 | 
				
			||||||
	/* Might as well keep this in alphabetic order */
 | 
						/* Might as well keep this in alphabetic order */
 | 
				
			||||||
	{"exc_info",	sys_exc_info, 0, exc_info_doc},
 | 
						{"exc_info",	sys_exc_info, 1, exc_info_doc},
 | 
				
			||||||
	{"exit",	sys_exit, 0, exit_doc},
 | 
						{"exit",	sys_exit, 0, exit_doc},
 | 
				
			||||||
#ifdef COUNT_ALLOCS
 | 
					#ifdef COUNT_ALLOCS
 | 
				
			||||||
	{"getcounts",	sys_getcounts, 0},
 | 
						{"getcounts",	sys_getcounts, 1},
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
#ifdef DYNAMIC_EXECUTION_PROFILE
 | 
					#ifdef DYNAMIC_EXECUTION_PROFILE
 | 
				
			||||||
	{"getdxp",	_Py_GetDXProfile, 1},
 | 
						{"getdxp",	_Py_GetDXProfile, 1},
 | 
				
			||||||
| 
						 | 
					@ -275,9 +275,9 @@ static PyMethodDef sys_methods[] = {
 | 
				
			||||||
#ifdef Py_TRACE_REFS
 | 
					#ifdef Py_TRACE_REFS
 | 
				
			||||||
	{"getobjects",	_Py_GetObjects, 1},
 | 
						{"getobjects",	_Py_GetObjects, 1},
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
	{"getrefcount",	sys_getrefcount, 0, getrefcount_doc},
 | 
						{"getrefcount",	sys_getrefcount, 1, getrefcount_doc},
 | 
				
			||||||
#ifdef USE_MALLOPT
 | 
					#ifdef USE_MALLOPT
 | 
				
			||||||
	{"mdebug",	sys_mdebug, 0},
 | 
						{"mdebug",	sys_mdebug, 1},
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
	{"setcheckinterval",	sys_setcheckinterval, 1, setcheckinterval_doc},
 | 
						{"setcheckinterval",	sys_setcheckinterval, 1, setcheckinterval_doc},
 | 
				
			||||||
	{"setprofile",	sys_setprofile, 0, setprofile_doc},
 | 
						{"setprofile",	sys_setprofile, 0, setprofile_doc},
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue