diff options
| author | Mikhail Denisenko <denisenkom@gmail.com> | 2014-10-02 21:58:36 -0400 |
|---|---|---|
| committer | Anssi Kääriäinen <akaariai@gmail.com> | 2014-10-27 14:51:40 +0200 |
| commit | d4bc0bf435402f32d1e31aeffd280276349283d8 (patch) | |
| tree | cd5a73d9e19db1e488f204835874c873d52e32a4 /django/db/backends/utils.py | |
| parent | 984a57a9c9cba44fde61e21c08996dc678f13e81 (diff) | |
Fixed #22879 -- Intercept errors coming from cursor.__next__()
Diffstat (limited to 'django/db/backends/utils.py')
| -rw-r--r-- | django/db/backends/utils.py | 4 |
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 |
