Skip to content

Commit 82ff87e

Browse files
Requested changes
1 parent 39ba777 commit 82ff87e

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

Lib/sqlite3/__main__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def runsource(self, source, filename="<input>", symbol="single"):
6060

6161
if not source or source.isspace():
6262
return False
63+
# Remember to update CLI_COMMANDS in _completer.py
6364
if source[0] == ".":
6465
match source[1:].strip():
6566
case "version":

Lib/sqlite3/_completer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
except ImportError:
66
SQLITE_KEYWORDS = ()
77

8-
SQLITE_KEYWORDS += ('.quit', '.help', '.version')
8+
CLI_COMMANDS = ('.quit', '.help', '.version')
99

1010
_completion_matches = []
1111

@@ -15,7 +15,7 @@ def _complete(text, state):
1515

1616
if state == 0:
1717
if text.startswith('.'):
18-
_completion_matches = [c for c in SQLITE_KEYWORDS if c.startswith(text)]
18+
_completion_matches = [c for c in CLI_COMMANDS if c.startswith(text)]
1919
else:
2020
text_upper = text.upper()
2121
_completion_matches = [c for c in SQLITE_KEYWORDS if c.startswith(text_upper)]

Lib/test/test_sqlite3/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def test_complete_no_input(self):
306306
self.assertEqual(len(indices), 2)
307307
start, end = indices
308308
candidates = [l.strip() for l in lines[start+1:end]]
309-
self.assertEqual(candidates, sorted(SQLITE_KEYWORDS + ('.help', '.quit', '.version')))
309+
self.assertEqual(candidates, sorted(SQLITE_KEYWORDS))
310310
except:
311311
if verbose:
312312
print(' PTY output: '.center(30, '-'))

0 commit comments

Comments
 (0)