mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-02-07 12:50:32 +03:00
Replaced PyObject_CallFunction() with *ObjArgs() where more efficient.
This commit is contained in:
parent
9fe0511711
commit
422fede38e
|
@ -1,3 +1,7 @@
|
|||
2010-11-09 Daniele Varrazzo <daniele.varrazzo@gmail.com>
|
||||
|
||||
* Replaced PyObject_CallFunction() with *ObjArgs() where more efficient.
|
||||
|
||||
2010-11-08 Daniele Varrazzo <daniele.varrazzo@gmail.com>
|
||||
|
||||
* psycopg/microprotocols.c: use faster function to build tuples.
|
||||
|
|
|
@ -241,5 +241,5 @@ psyco_AsIs(PyObject *module, PyObject *args)
|
|||
if (!PyArg_ParseTuple(args, "O", &obj))
|
||||
return NULL;
|
||||
|
||||
return PyObject_CallFunction((PyObject *)&asisType, "O", obj);
|
||||
return PyObject_CallFunctionObjArgs((PyObject *)&asisType, obj, NULL);
|
||||
}
|
||||
|
|
|
@ -325,5 +325,5 @@ psyco_Binary(PyObject *module, PyObject *args)
|
|||
if (!PyArg_ParseTuple(args, "O", &str))
|
||||
return NULL;
|
||||
|
||||
return PyObject_CallFunction((PyObject *)&binaryType, "O", str);
|
||||
return PyObject_CallFunctionObjArgs((PyObject *)&binaryType, str, NULL);
|
||||
}
|
||||
|
|
|
@ -254,5 +254,5 @@ psyco_Boolean(PyObject *module, PyObject *args)
|
|||
if (!PyArg_ParseTuple(args, "O", &obj))
|
||||
return NULL;
|
||||
|
||||
return PyObject_CallFunction((PyObject *)&pbooleanType, "O", obj);
|
||||
return PyObject_CallFunctionObjArgs((PyObject *)&pbooleanType, obj, NULL);
|
||||
}
|
||||
|
|
|
@ -276,5 +276,5 @@ psyco_Decimal(PyObject *module, PyObject *args)
|
|||
if (!PyArg_ParseTuple(args, "O", &obj))
|
||||
return NULL;
|
||||
|
||||
return PyObject_CallFunction((PyObject *)&pdecimalType, "O", obj);
|
||||
return PyObject_CallFunctionObjArgs((PyObject *)&pdecimalType, obj, NULL);
|
||||
}
|
||||
|
|
|
@ -246,5 +246,5 @@ psyco_Float(PyObject *module, PyObject *args)
|
|||
if (!PyArg_ParseTuple(args, "O", &obj))
|
||||
return NULL;
|
||||
|
||||
return PyObject_CallFunction((PyObject *)&pfloatType, "O", obj);
|
||||
return PyObject_CallFunctionObjArgs((PyObject *)&pfloatType, obj, NULL);
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ psyco_conn_cursor(connectionObject *self, PyObject *args, PyObject *keywds)
|
|||
if (name)
|
||||
obj = PyObject_CallFunction(factory, "Os", self, name);
|
||||
else
|
||||
obj = PyObject_CallFunction(factory, "O", self);
|
||||
obj = PyObject_CallFunctionObjArgs(factory, self, NULL);
|
||||
|
||||
if (obj == NULL) return NULL;
|
||||
if (PyObject_IsInstance(obj, (PyObject *)&cursorType) == 0) {
|
||||
|
|
|
@ -726,7 +726,7 @@ _psyco_curs_buildrow_with_factory(cursorObject *self, int row)
|
|||
PyObject *res;
|
||||
|
||||
n = PQnfields(self->pgres);
|
||||
if ((res = PyObject_CallFunction(self->tuple_factory, "O", self))== NULL)
|
||||
if (!(res = PyObject_CallFunctionObjArgs(self->tuple_factory, self, NULL)))
|
||||
return NULL;
|
||||
|
||||
return _psyco_curs_buildrow_fill(self, res, row, n, 0);
|
||||
|
|
Loading…
Reference in New Issue
Block a user