Skip to content

Commit 33531dd

Browse files
StanFromIrelandpicnixzserhiy-storchaka
committed
[3.14] pythongh-133439: Fix the error message in the sqlite3 CLI (pythonGH-133807)
(cherry picked from commit ecd83e0) Co-authored-by: Stan Ulbrych <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]> Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent 53b36e0 commit 33531dd

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Lib/sqlite3/__main__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,15 @@ def runsource(self, source, filename="<input>", symbol="single"):
5353
if source[0] == ".":
5454
match source[1:].strip():
5555
case "version":
56-
print(f"{sqlite3.sqlite_version}")
56+
print(sqlite3.sqlite_version)
5757
case "help":
5858
print("Enter SQL code and press enter.")
5959
case "quit":
6060
sys.exit(0)
6161
case "":
6262
pass
6363
case _ as unknown:
64-
self.write("Error: unknown command or invalid arguments:"
65-
f' "{unknown}".\n')
64+
self.write(f'Error: unknown command: "{unknown}"\n')
6665
else:
6766
if not sqlite3.complete_statement(source):
6867
return True

Lib/test/test_sqlite3/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def test_interact_dot_commands_unknown(self):
129129
self.assertEndsWith(out, self.PS1)
130130
self.assertEqual(out.count(self.PS1), 2)
131131
self.assertEqual(out.count(self.PS2), 0)
132-
self.assertIn("Error", err)
132+
self.assertIn('Error: unknown command: "', err)
133133
# test "unknown_command" is pointed out in the error message
134134
self.assertIn("unknown_command", err)
135135

0 commit comments

Comments
 (0)