Changed re-raising an exception to use bare raise syntax where appropriate.

This commit is contained in:
Jon Dufresne 2020-01-19 14:13:58 -08:00 committed by Mariusz Felisiak
parent b64b1b2e1a
commit 26be703fe6
4 changed files with 5 additions and 5 deletions

View File

@ -26,7 +26,7 @@ class DatabaseCreation(BaseDatabaseCreation):
self.log('Got an error creating the test database: %s' % e)
sys.exit(2)
else:
raise e
raise
def _clone_test_db(self, suffix, verbosity, keepdb=False):
source_database_name = self.connection.settings_dict['NAME']

View File

@ -48,7 +48,7 @@ class DatabaseCreation(BaseDatabaseCreation):
elif not keepdb:
# If the database should be kept, ignore "database already
# exists".
raise e
raise
def _clone_test_db(self, suffix, verbosity, keepdb=False):
# CREATE DATABASE ... WITH TEMPLATE ... requires closing connections

View File

@ -269,7 +269,7 @@ class MigrationLoader:
),
exc.node
) from exc
raise exc
raise
self.graph.ensure_not_cyclic()
def check_consistent_history(self, connection):

View File

@ -607,13 +607,13 @@ class QuerySet:
params = dict(resolve_callables(params))
obj = self.create(**params)
return obj, True
except IntegrityError as e:
except IntegrityError:
try:
qs = self.select_for_update() if lock else self
return qs.get(**lookup), False
except self.model.DoesNotExist:
pass
raise e
raise
def _extract_model_params(self, defaults, **kwargs):
"""