Give the Python binding a better chance to work
This commit is contained in:
parent
bf415e7ca4
commit
d468a37a37
|
@ -101,11 +101,11 @@ static PyObject * _libdatabase_database_get_last_id(PyObject * self,
|
|||
Database * database;
|
||||
long long ret;
|
||||
|
||||
if(!PyArg_ParseTuple(args, "O", &self))
|
||||
return NULL;
|
||||
if((database = PyCapsule_GetPointer(self, _libdatabase_database_name))
|
||||
== NULL)
|
||||
return NULL;
|
||||
if(!PyArg_ParseTuple(args, ""))
|
||||
return NULL;
|
||||
ret = database_get_last_id(database);
|
||||
return Py_BuildValue("L", ret);
|
||||
}
|
||||
|
@ -118,11 +118,11 @@ static PyObject * _libdatabase_database_query(PyObject * self, PyObject * args)
|
|||
char const * query;
|
||||
int ret;
|
||||
|
||||
if(!PyArg_ParseTuple(args, "Os", &self, &query))
|
||||
return NULL;
|
||||
if((database = PyCapsule_GetPointer(self, _libdatabase_database_name))
|
||||
== NULL)
|
||||
return NULL;
|
||||
if(!PyArg_ParseTuple(args, "s", &query))
|
||||
return NULL;
|
||||
/* FIXME implement the callbacks one way or another */
|
||||
ret = database_query(database, query, NULL, NULL);
|
||||
return Py_BuildValue("i", ret);
|
||||
|
|
Loading…
Reference in New Issue
Block a user