summaryrefslogtreecommitdiff
path: root/django/db/models/sql
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-01-21 20:02:00 -0500
committerGitHub <noreply@github.com>2017-01-21 20:02:00 -0500
commitd170c63351944fd91b2206d10f89e7ff75b53b76 (patch)
treee2be66471ab071fa0ce75097d66650b650c53853 /django/db/models/sql
parentc22212220a7900173358a1f16179dcfc9e03de78 (diff)
Refs #23919 -- Removed misc references to Python 2.
Diffstat (limited to 'django/db/models/sql')
-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: