PyObject_Length() == -1 on error. Thanks, Jon Ribbens.

This commit is contained in:
adustman
2001-05-14 18:49:27 +00:00
parent ce00d83836
commit 05d3f63ac1

View File

@ -522,7 +522,7 @@ _mysql_escape_sequence(
"argument 2 must be a mapping"); "argument 2 must be a mapping");
return NULL; return NULL;
} }
if (!(n = PyObject_Length(o))) goto error; if ((n = PyObject_Length(o)) == -1) goto error;
if (!(r = PyTuple_New(n))) goto error; if (!(r = PyTuple_New(n))) goto error;
for (i=0; i<n; i++) { for (i=0; i<n; i++) {
item = PySequence_GetItem(o, i); item = PySequence_GetItem(o, i);