mirror of
https://github.com/django/django.git
synced 2025-04-21 07:44:36 +00:00
[4.2.x] Prevented PostgreSQL's DatabaseCreation._execute_create_test_db() from hiding clause-less exceptions.
Regression in 3cafb783f3f711c7413ba2b8d7c8ff750bd4d6e1. Backport of 465f3c045b2cb7d757a8cbabc909c137901c9844 from main
This commit is contained in:
parent
48d5889de9
commit
837e68a1bf
@ -45,8 +45,7 @@ class DatabaseCreation(BaseDatabaseCreation):
|
||||
return
|
||||
super()._execute_create_test_db(cursor, parameters, keepdb)
|
||||
except Exception as e:
|
||||
cause = e.__cause__
|
||||
if cause and not isinstance(cause, errors.DuplicateDatabase):
|
||||
if not isinstance(e.__cause__, errors.DuplicateDatabase):
|
||||
# All errors except "database already exists" cancel tests.
|
||||
self.log("Got an error creating the test database: %s" % e)
|
||||
sys.exit(2)
|
||||
|
Loading…
x
Reference in New Issue
Block a user