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 c81522079e
commit 13b0852619

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"); "can't call .execute() on named cursors more than once");
return NULL; return NULL;
} }
if (self->conn->autocommit) { if (self->conn->autocommit && !self->withhold) {
psyco_set_error(ProgrammingError, self, psyco_set_error(ProgrammingError, self,
"can't use a named cursor outside of transactions"); "can't use a named cursor outside of transactions");
return NULL; return NULL;