mirror of
https://github.com/Hopiu/django.git
synced 2026-04-13 11:31:13 +00:00
Fixed #22879 -- Intercept errors coming from cursor.__next__()
This commit is contained in:
parent
984a57a9c9
commit
d4bc0bf435
1 changed files with 3 additions and 1 deletions
|
|
@ -29,7 +29,9 @@ class CursorWrapper(object):
|
|||
return cursor_attr
|
||||
|
||||
def __iter__(self):
|
||||
return iter(self.cursor)
|
||||
with self.db.wrap_database_errors:
|
||||
for item in self.cursor:
|
||||
yield item
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
|
|
|||
Loading…
Reference in a new issue