From: Bernhard H. <bh...@in...> - 2002-02-06 18:30:59
|
The doc-string of the connection's getResult method says that it returns None if PQgetResult returns NULL to indicate that the query is done, however, it raises an exception instead because it doesn't even check the pointer it gets. Here's a patch (relative to pgconnection.c 1.16): *** pgconnection.c.orig Wed Feb 6 18:42:32 2002 --- pgconnection.c Wed Feb 6 18:43:05 2002 *************** *** 400,405 **** --- 400,412 ---- res = PQgetResult(PgConnection_Get(self)); + if (!res) + { + /* the query is done. Return None */ + Py_INCREF(Py_None); + return Py_None; + } + if ((rtype = getResultType(res)) == RESULT_ERROR) { PyObject *exc; Bernhard -- Intevation GmbH http://intevation.de/ Sketch http://sketch.sourceforge.net/ MapIt! http://mapit.de/ |