| static PyObject * |
| _mysql_escape_sequence( |
| PyObject *self, |
| PyObject *args) |
| { |
| PyObject *o=NULL, *d=NULL, *r=NULL, *item, *quoted; |
| int i, n; |
| if (!PyArg_ParseTuple(args, "OO:escape_sequence", &o, &d)) |
| goto error; |
| if (!PyMapping_Check(d)) { |
| PyErr_SetString(PyExc_TypeError, |
| "argument 2 must be a mapping"); |
| return NULL; |
| } |
| if ((n = PyObject_Length(o)) == -1) goto error; |
| if (!(r = PyTuple_New(n))) goto error; |
| for (i=0; i<n; i++) { |
| item = PySequence_GetItem(o, i); |
| if (!item) goto error; |
| quoted = _escape_item(item, d); |
| Py_DECREF(item); |
| if (!quoted) goto error; |
| PyTuple_SET_ITEM(r, i, quoted); |
| } |
| return r; |
| error: |
| Py_XDECREF(r); |
| return NULL; |
| } |
found 1 similar trace(s) to this
when PyArg_ParseTuple() succeeds
taking False path
when considering range: -0x80000000 <= value <= -1
taking False path
when considering value == (int)-1 from _mysql.c:1241
taking True path
taking True path