Awkwardness of C API for making tuples
Fredrik Lundh
fredrik at pythonware.com
Thu Feb 3 02:41:57 EST 2005
More information about the Python-list mailing list
Thu Feb 3 02:41:57 EST 2005
- Previous message (by thread): Awkwardness of C API for making tuples
- Next message (by thread): Awkwardness of C API for making tuples
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Dave Cole wrote:
> for (i = 0; i < num_values; i++) {
> PyObject *obj;
>
> obj = PyInt_FromLong(value[i]);
> if (obj == NULL
> || PyTuple_SetItem(tuple, i, obj) != 0) {
> Py_DECREF(tuple);
> return NULL;
> }
> }
in theory, if PyInt_FromLong succeeds, and PyTuple_SetItem fails, you'll leak
an object.
</F>
- Previous message (by thread): Awkwardness of C API for making tuples
- Next message (by thread): Awkwardness of C API for making tuples
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list