1261 static PyObject *
1262 _mysql_escape_dict(
1263 PyObject *self,
1264 PyObject *args)
1265 {
1266 PyObject *o=NULL, *d=NULL, *r=NULL, *item, *quoted, *pkey;
1267 Py_ssize_t ppos = 0;
1268 if (!PyArg_ParseTuple(args, "O!O:escape_dict", &PyDict_Type, &o, &d))
when PyArg_ParseTuple() succeeds
taking False path
1269 goto error;
1270 if (!PyMapping_Check(d)) {
when considering range: -0x80000000 <= value <= -1
taking False path
1271 PyErr_SetString(PyExc_TypeError,
1272 "argument 2 must be a mapping");
1273 return NULL;
1274 }
1275 if (!(r = PyDict_New())) goto error;
when PyDict_New() succeeds
taking False path
1276 while (PyDict_Next(o, &ppos, &pkey, &item)) {
when considering range: -0x80000000 <= value <= -1
taking True path
1277 quoted = _escape_item(item, d);
when _escape_item() succeeds
'*quoted' was allocated at: quoted = _escape_item(item, d);
ob_refcnt is now refs: 1 owned
1278 if (!quoted) goto error;
taking False path
1279 if (PyDict_SetItem(r, pkey, quoted)==-1) goto error;
when treating unknown struct PyObject * * from _mysql.c:1276 as non-NULL
when PyDict_SetItem() fails
taking True path
1280 Py_DECREF(quoted);
1281 }
1282 return r;
1283 error:
1284 Py_XDECREF(r);
taking False path
when taking True path
1285 return NULL;
1286 }