Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address Adam's review: focus on the happy path
  • Loading branch information
erlend-aasland committed Jun 16, 2022
commit 2434ba2be26b7838779e59ca8c24b5947dfd8624
11 changes: 6 additions & 5 deletions Doc/library/sqlite3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1434,12 +1434,13 @@ case-insensitively by name:
Using the connection as a context manager
Comment thread
erlend-aasland marked this conversation as resolved.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Connection objects can be used as context managers
that automatically commit or rollback transactions,
*if* there is an open transaction.
With an open transaction, connection objects can be used as context managers
that automatically commit or rollback transactions.
If the body of the ``with`` statement finishes without exceptions,
Comment thread
erlend-aasland marked this conversation as resolved.
Outdated
the transaction is committed.
Comment thread
erlend-aasland marked this conversation as resolved.
If an exception is raised and not caught, the transaction is rolled back.

If there is no open transaction, the context manager is a no-op.
Comment thread
erlend-aasland marked this conversation as resolved.
Outdated
In the event of an exception, the transaction is rolled back;
otherwise, the transaction is committed:

.. note::

Expand Down