]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-109234: Hint to contextlib.closing in sqlite3 context manager docs (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 3 Oct 2023 16:02:04 +0000 (09:02 -0700)
committerGitHub <noreply@github.com>
Tue, 3 Oct 2023 16:02:04 +0000 (16:02 +0000)
(cherry picked from commit 4227bfa8b273207a2b882f7d69c8ac49c3d2b57d)

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>
Doc/library/sqlite3.rst

index f3bcfb5a28f9a3ac7c116b33717419d12485939a..c85f4fc49c070ed6eeb5b7c17a0298a81d24b1ca 100644 (file)
@@ -2195,9 +2195,9 @@ If there is no open transaction upon leaving the body of the ``with`` statement,
 the context manager is a no-op.
 
 .. 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::