Allow using named with hold cursors in autocommit

This commit is contained in:
Alexey Borzenkov 2013-07-09 23:29:58 +04:00 committed by Daniele Varrazzo
parent 75a0b2ffe2
commit e08be44db7

View File

@ -478,7 +478,7 @@ psyco_curs_execute(cursorObject *self, PyObject *args, PyObject *kwargs)
"can't call .execute() on named cursors more than once");
return NULL;
}
if (self->conn->autocommit) {
if (self->conn->autocommit && !self->withhold) {
psyco_set_error(ProgrammingError, self,
"can't use a named cursor outside of transactions");
return NULL;