Minor bugfix on _mysql: Set exception if non-sequence is passed to

escape_row().

Updating for version 2.0 of the API.
This commit is contained in:
adustman
1999-03-30 07:59:51 +00:00
parent 55d15aeb83
commit 675b285a7b
2 changed files with 79 additions and 30 deletions

View File

@ -508,7 +508,10 @@ _mysql_escape_row(self, args)
char *in, *out;
int i, n, len, size;
if (!PyArg_ParseTuple(args, "O:escape_row", &o)) goto error2;
if (!PySequence_Check(o)) goto error2;
if (!PySequence_Check(o)) {
PyErr_SetString(PyExc_TypeError, "sequence required");
goto error2;
}
if (!(n = PyObject_Length(o))) goto error2;
if (!(r = PyTuple_New(n))) goto error;
for (i=0; i<n; i++) {