summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2014-04-24 08:41:37 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2014-04-24 08:43:16 +0200
commit5cd64296205e1b5cc4fc1f7e02e22d62795bb604 (patch)
treec57f69f3b25675a4a44d173093e800773a5897a7
parente32e359d6ab4e91bbf8fd67d96a687d0006d38b9 (diff)
[1.7.x] Prevented a crash in the cursor wrappers on Oracle.
Fixed #22483 (again). Backport of 0f85103e from master
-rw-r--r--django/db/backends/utils.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/django/db/backends/utils.py b/django/db/backends/utils.py
index 9c4d15d8ce..29a8265763 100644
--- a/django/db/backends/utils.py
+++ b/django/db/backends/utils.py
@@ -36,8 +36,12 @@ class CursorWrapper(object):
def __exit__(self, type, value, traceback):
# Ticket #17671 - Close instead of passing thru to avoid backend
- # specific behavior.
- self.close()
+ # specific behavior. Catch errors liberally because errors in cleanup
+ # code aren't useful.
+ try:
+ self.close()
+ except self.db.Database.Error:
+ pass
# The following methods cannot be implemented in __getattr__, because the
# code must run when the method is invoked, not just when it is accessed.