summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/base.py
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2021-02-02 21:34:36 +0100
committerGitHub <noreply@github.com>2021-02-02 21:34:36 +0100
commitf131841c601b9d4884adcdb284b4213c2ad89231 (patch)
tree25a00660711853a453a208d88a4affcd751a258f /django/db/backends/postgresql/base.py
parentf9cfd346f0222d86bfbac26ef5455806965bae6b (diff)
Fixed #32403 -- Fixed re-raising DatabaseErrors when using only 'postgres' database.
Thanks Kazantcev Andrey for the report. Regression in f48f671223a20b161ca819cf7d6298e43b8ba5fe.
Diffstat (limited to 'django/db/backends/postgresql/base.py')
-rw-r--r--django/db/backends/postgresql/base.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/django/db/backends/postgresql/base.py b/django/db/backends/postgresql/base.py
index 7926c05c09..126f30b462 100644
--- a/django/db/backends/postgresql/base.py
+++ b/django/db/backends/postgresql/base.py
@@ -332,6 +332,9 @@ class DatabaseWrapper(BaseDatabaseWrapper):
yield cursor
finally:
conn.close()
+ break
+ else:
+ raise
@cached_property
def pg_version(self):