Skip to content

Commit bc1fe35

Browse files
[3.12] gh-109151: Enable readline in the sqlite3 CLI (GH-109152) (#110352)
gh-109151: Enable readline in the sqlite3 CLI (GH-109152) (cherry picked from commit 254e30c) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent 7ec3487 commit bc1fe35

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Lib/sqlite3/__main__.py

+4
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ def main(*args):
116116
else:
117117
# No SQL provided; start the REPL.
118118
console = SqliteInteractiveConsole(con)
119+
try:
120+
import readline
121+
except ImportError:
122+
pass
119123
console.interact(banner, exitmsg="")
120124
finally:
121125
con.close()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Enable ``readline`` editing features in the :ref:`sqlite3 command-line interface <sqlite3-cli>` (``python -m sqlite3``).

0 commit comments

Comments
 (0)