mirror of
https://github.com/python/cpython.git
synced 2025-10-02 13:22:19 +00:00
[3.12] gh-109234: Hint to contextlib.closing in sqlite3 context manager docs (GH-109322) (#110294)
(cherry picked from commit 4227bfa8b2
)
Co-authored-by: Lincoln <71312724+Lincoln-developer@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
This commit is contained in:
parent
4dac406f66
commit
90dea557bb
1 changed files with 2 additions and 2 deletions
|
@ -2406,9 +2406,9 @@ or if :attr:`~Connection.autocommit` is ``True``,
|
|||
the context manager does nothing.
|
||||
|
||||
.. note::
|
||||
|
||||
The context manager neither implicitly opens a new transaction
|
||||
nor closes the connection.
|
||||
nor closes the connection. If you need a closing context manager, consider
|
||||
using :meth:`contextlib.closing`.
|
||||
|
||||
.. testcode::
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue