mirror of
https://github.com/python/cpython.git
synced 2025-12-04 16:43:27 +00:00
[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 254e30c487)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
7ec34874e3
commit
bc1fe3549b
2 changed files with 5 additions and 0 deletions
|
|
@ -116,6 +116,10 @@ def main(*args):
|
||||||
else:
|
else:
|
||||||
# No SQL provided; start the REPL.
|
# No SQL provided; start the REPL.
|
||||||
console = SqliteInteractiveConsole(con)
|
console = SqliteInteractiveConsole(con)
|
||||||
|
try:
|
||||||
|
import readline
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
console.interact(banner, exitmsg="")
|
console.interact(banner, exitmsg="")
|
||||||
finally:
|
finally:
|
||||||
con.close()
|
con.close()
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
Enable ``readline`` editing features in the :ref:`sqlite3 command-line interface <sqlite3-cli>` (``python -m sqlite3``).
|
||||||
Loading…
Add table
Add a link
Reference in a new issue