summaryrefslogtreecommitdiff
path: root/django/db/models/sql/compiler.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/models/sql/compiler.py')
-rw-r--r--django/db/models/sql/compiler.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py
index 1be406d704..5e5984dfb3 100644
--- a/django/db/models/sql/compiler.py
+++ b/django/db/models/sql/compiler.py
@@ -875,14 +875,8 @@ class SQLCompiler:
try:
cursor.execute(sql, params)
except Exception:
- try:
- # Might fail for server-side cursors (e.g. connection closed)
- cursor.close()
- except Exception:
- # Ignore clean up errors and raise the original error instead.
- # Python 2 doesn't chain exceptions. Remove this error
- # silencing when dropping Python 2 compatibility.
- pass
+ # Might fail for server-side cursors (e.g. connection closed)
+ cursor.close()
raise
if result_type == CURSOR: