From 05d3f63ac1a3373c9c59b8924a8dac560790ae84 Mon Sep 17 00:00:00 2001 From: adustman Date: Mon, 14 May 2001 18:49:27 +0000 Subject: [PATCH] PyObject_Length() == -1 on error. Thanks, Jon Ribbens. --- MySQLdb/_mysql.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MySQLdb/_mysql.c b/MySQLdb/_mysql.c index 7117f8a..8b839e8 100644 --- a/MySQLdb/_mysql.c +++ b/MySQLdb/_mysql.c @@ -522,7 +522,7 @@ _mysql_escape_sequence( "argument 2 must be a mapping"); return NULL; } - if (!(n = PyObject_Length(o))) goto error; + if ((n = PyObject_Length(o)) == -1) goto error; if (!(r = PyTuple_New(n))) goto error; for (i=0; i