Don't call fetch on closed result proxy

"The DBAPI cursor will be closed by the ResultProxy when all of its result rows (if any) are exhausted"
See http://docs.sqlalchemy.org/en/latest/core/connections.html
This commit is contained in:
Stefan Wehrmeyer 2015-12-20 13:15:39 +01:00
parent 9d0b6503d7
commit d16f1df8cd

View File

@ -50,6 +50,8 @@ class ResultIter(object):
self._iter = None self._iter = None
def _next_chunk(self): def _next_chunk(self):
if self.result_proxy.closed:
return False
if not self.step: if not self.step:
chunk = self.result_proxy.fetchall() chunk = self.result_proxy.fetchall()
else: else: