diff options
| author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2010-11-09 01:49:22 +0000 |
|---|---|---|
| committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2010-11-09 01:49:22 +0000 |
| commit | 422fede38eed9667a2200f0aaf4afe9e3ac9d551 (patch) | |
| tree | 626901bba9332238692307379cebafda833cae82 | |
| parent | 9fe0511711508a24337829597de5578705023e15 (diff) | |
| download | psycopg2-422fede38eed9667a2200f0aaf4afe9e3ac9d551.tar.gz | |
Replaced PyObject_CallFunction() with *ObjArgs() where more efficient.
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | psycopg/adapter_asis.c | 2 | ||||
| -rw-r--r-- | psycopg/adapter_binary.c | 2 | ||||
| -rw-r--r-- | psycopg/adapter_pboolean.c | 2 | ||||
| -rw-r--r-- | psycopg/adapter_pdecimal.c | 2 | ||||
| -rw-r--r-- | psycopg/adapter_pfloat.c | 2 | ||||
| -rw-r--r-- | psycopg/connection_type.c | 2 | ||||
| -rw-r--r-- | psycopg/cursor_type.c | 2 |
8 files changed, 11 insertions, 7 deletions
@@ -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. diff --git a/psycopg/adapter_asis.c b/psycopg/adapter_asis.c index 7d049c2..4b50e9d 100644 --- a/psycopg/adapter_asis.c +++ b/psycopg/adapter_asis.c @@ -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); } diff --git a/psycopg/adapter_binary.c b/psycopg/adapter_binary.c index a1dfba5..641d317 100644 --- a/psycopg/adapter_binary.c +++ b/psycopg/adapter_binary.c @@ -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); } diff --git a/psycopg/adapter_pboolean.c b/psycopg/adapter_pboolean.c index a52cece..4fd143b 100644 --- a/psycopg/adapter_pboolean.c +++ b/psycopg/adapter_pboolean.c @@ -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); } diff --git a/psycopg/adapter_pdecimal.c b/psycopg/adapter_pdecimal.c index c11e753..e5c039a 100644 --- a/psycopg/adapter_pdecimal.c +++ b/psycopg/adapter_pdecimal.c @@ -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); } diff --git a/psycopg/adapter_pfloat.c b/psycopg/adapter_pfloat.c index 7c1fe77..ccfad74 100644 --- a/psycopg/adapter_pfloat.c +++ b/psycopg/adapter_pfloat.c @@ -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); } diff --git a/psycopg/connection_type.c b/psycopg/connection_type.c index bc3aa87..c4d4671 100644 --- a/psycopg/connection_type.c +++ b/psycopg/connection_type.c @@ -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) { diff --git a/psycopg/cursor_type.c b/psycopg/cursor_type.c index 949433b..0809ac7 100644 --- a/psycopg/cursor_type.c +++ b/psycopg/cursor_type.c @@ -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); |
