Skip to content

Commit 4227bfa

Browse files
Lincoln-developerblurb-it[bot]erlend-aasland
authored
Enhanced sqlite3 connection context management documentation with contextlib.closing gh-109234 (#109322)
* Enhanced sqlite3 connection context management documentation with contextlib.closing * 📜🤖 Added by blurb_it. * Fixed gitignore spelling error from nitignore to gitignore * Renamed .gitignore to .nitignore * Added generated doctests * Deleted sqlite3 generated files * Removed white-space changes * Removed News entry from the doc * Expanded a note that context manager can be used for connection management using contextlib.closing * Removed repeated contextlib.closing code snippet * Expanded the note around usage of context manageer for sqlite3 connection management * Deleted extra white-spaces * Deleted extra white-space * re-arranged context manager wording * Re-arranged word layout on how to use context manager * Fix whitespace errors * Remove unneeded change in .gitignore * Added suggested changes * Added suggested change redirecting to the contextlib.closing implementation * Added closing keyword * Removed line 2473 --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <[email protected]>
1 parent 2d4865d commit 4227bfa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/library/sqlite3.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2437,9 +2437,9 @@ or if :attr:`~Connection.autocommit` is ``True``,
24372437
the context manager does nothing.
24382438

24392439
.. note::
2440-
24412440
The context manager neither implicitly opens a new transaction
2442-
nor closes the connection.
2441+
nor closes the connection. If you need a closing context manager, consider
2442+
using :meth:`contextlib.closing`.
24432443

24442444
.. testcode::
24452445

0 commit comments

Comments
 (0)