1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #30116 -- Dropped support for Python 3.5.

This commit is contained in:
Tim Graham
2019-01-18 10:04:29 -05:00
parent 5a5c77d55d
commit 7e6b214ed3
23 changed files with 25 additions and 141 deletions

View File

@@ -173,14 +173,6 @@ class Atomic(ContextDecorator):
connection.commit_on_exit = True
connection.needs_rollback = False
if not connection.get_autocommit():
# sqlite3 in Python < 3.6 doesn't handle transactions and
# savepoints properly when autocommit is off.
# Turning autocommit back on isn't an option; it would trigger
# a premature commit. Give up if that happens.
if connection.features.autocommits_when_autocommit_is_off:
raise TransactionManagementError(
"Your database backend doesn't behave properly when "
"autocommit is off. Turn it on before using 'atomic'.")
# Pretend we're already in an atomic block to bypass the code
# that disables autocommit to enter a transaction, and make a
# note to deal with this case in __exit__.