Propagate iterable exceptions to the executemany caller.

This commit is contained in:
Daniele Varrazzo 2010-07-09 23:10:11 +01:00
parent bd6a4139da
commit 3773b50bb3
2 changed files with 12 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2010-07-09 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* psycopg/cursor_type.c: executemany() propagates exceptions raised by the
iterable to the caller.
2010-05-20 Daniele Varrazzo <daniele.varrazzo@gmail.com> 2010-05-20 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* psycopg/typecast_datetime.c: Round seconds in historical timezones to * psycopg/typecast_datetime.c: Round seconds in historical timezones to

View File

@ -534,8 +534,13 @@ psyco_curs_executemany(cursorObject *self, PyObject *args, PyObject *kwargs)
Py_XDECREF(iter); Py_XDECREF(iter);
self->rowcount = rowcount; self->rowcount = rowcount;
if (!PyErr_Occurred()) {
Py_INCREF(Py_None); Py_INCREF(Py_None);
return Py_None; return Py_None;
}
else {
return NULL;
}
} }