Removed useless check in sqlite's DatabaseWrapper._savepoint_allowed().

Obsolete since 27193aea00.
This commit is contained in:
Tim Graham 2018-10-25 10:17:37 -04:00
parent 9b52bd6575
commit f1d1634493
1 changed files with 1 additions and 5 deletions

View File

@ -227,16 +227,12 @@ class DatabaseWrapper(BaseDatabaseWrapper):
BaseDatabaseWrapper.close(self) BaseDatabaseWrapper.close(self)
def _savepoint_allowed(self): def _savepoint_allowed(self):
# Two conditions are required here:
# - A sufficiently recent version of SQLite to support savepoints,
# - Being in a transaction, which can only happen inside 'atomic'.
# When 'isolation_level' is not None, sqlite3 commits before each # When 'isolation_level' is not None, sqlite3 commits before each
# savepoint; it's a bug. When it is None, savepoints don't make sense # savepoint; it's a bug. When it is None, savepoints don't make sense
# because autocommit is enabled. The only exception is inside 'atomic' # because autocommit is enabled. The only exception is inside 'atomic'
# blocks. To work around that bug, on SQLite, 'atomic' starts a # blocks. To work around that bug, on SQLite, 'atomic' starts a
# transaction explicitly rather than simply disable autocommit. # transaction explicitly rather than simply disable autocommit.
return self.features.uses_savepoints and self.in_atomic_block return self.in_atomic_block
def _set_autocommit(self, autocommit): def _set_autocommit(self, autocommit):
if autocommit: if autocommit: