Changed re-raising an exception to use bare raise syntax where appropriate.
This commit is contained in:
parent
b64b1b2e1a
commit
26be703fe6
|
@ -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']
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -269,7 +269,7 @@ class MigrationLoader:
|
|||
),
|
||||
exc.node
|
||||
) from exc
|
||||
raise exc
|
||||
raise
|
||||
self.graph.ensure_not_cyclic()
|
||||
|
||||
def check_consistent_history(self, connection):
|
||||
|
|
|
@ -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):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue