Prevented PostgreSQL's DatabaseCreation._execute_create_test_db() from hiding clause-less exceptions.

Regression in 3cafb783f3.
This commit is contained in:
Tim Graham 2023-04-02 23:54:34 -04:00 committed by GitHub
parent 56dadad743
commit 465f3c045b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -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)