Mercurial > p > mysql-python > mysqldb-2
diff _mysql.c @ 41:e80676c3505f MySQLdb
More NOARGS, with test coverage
author | kylev |
---|---|
date | Sun, 15 Feb 2009 07:56:43 +0000 |
parents | 78e810705b3d |
children |
line wrap: on
line diff
--- a/_mysql.c Sun Feb 15 07:26:43 2009 +0000 +++ b/_mysql.c Sun Feb 15 07:56:43 2009 +0000 @@ -159,7 +159,7 @@ static PyObject *_mysql_server_end( PyObject *self, - PyObject *args) { + PyObject *unused) { if (_mysql_server_init_done) { #if MYSQL_VERSION_ID >= 40000 mysql_server_end(); @@ -177,12 +177,10 @@ static PyObject *_mysql_thread_safe( PyObject *self, - PyObject *args) { - PyObject *flag; - if (!PyArg_ParseTuple(args, "")) return NULL; + PyObject *unused) { + check_server_init(NULL); - if (!(flag=PyInt_FromLong((long)mysql_thread_safe()))) return NULL; - return flag; + return PyInt_FromLong((long)mysql_thread_safe()); } #endif @@ -328,9 +326,8 @@ static PyObject * _mysql_get_client_info( PyObject *self, - PyObject *args) + PyObject *unused) { - if (!PyArg_ParseTuple(args, "")) return NULL; check_server_init(NULL); return PyString_FromString(mysql_get_client_info()); } @@ -385,14 +382,14 @@ { "get_client_info", (PyCFunction)_mysql_get_client_info, - METH_VARARGS, + METH_NOARGS, _mysql_get_client_info__doc__ }, #if MYSQL_VERSION_ID >= 32314 { "thread_safe", (PyCFunction)_mysql_thread_safe, - METH_VARARGS, + METH_NOARGS, _mysql_thread_safe__doc__ }, #endif @@ -405,7 +402,7 @@ { "server_end", (PyCFunction)_mysql_server_end, - METH_VARARGS, + METH_NOARGS, _mysql_server_end__doc__ }, {NULL, NULL} /* sentinel */