aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/sqlite3/__main__.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/sqlite3/__main__.py')
-rw-r--r--Lib/sqlite3/__main__.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/sqlite3/__main__.py b/Lib/sqlite3/__main__.py
index c2fa23c46cf..9e74b49ee82 100644
--- a/Lib/sqlite3/__main__.py
+++ b/Lib/sqlite3/__main__.py
@@ -12,6 +12,8 @@ from code import InteractiveConsole
from textwrap import dedent
from _colorize import get_theme, theme_no_color
+from ._completer import completer
+
def execute(c, sql, suppress_errors=True, theme=theme_no_color):
"""Helper that wraps execution of SQL code.
@@ -136,12 +138,9 @@ def main(*args):
execute(con, args.sql, suppress_errors=False, theme=theme)
else:
# No SQL provided; start the REPL.
- console = SqliteInteractiveConsole(con, use_color=True)
- try:
- import readline # noqa: F401
- except ImportError:
- pass
- console.interact(banner, exitmsg="")
+ with completer():
+ console = SqliteInteractiveConsole(con, use_color=True)
+ console.interact(banner, exitmsg="")
finally:
con.close()