summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--django/db/backends/utils.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/django/db/backends/utils.py b/django/db/backends/utils.py
index 77132e3f25..a95255b862 100644
--- a/django/db/backends/utils.py
+++ b/django/db/backends/utils.py
@@ -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