diff --git a/Lib/sqlite3/__main__.py b/Lib/sqlite3/__main__.py
index c2fa23c46cf990..f8a995dcd4ccf6 100644
--- a/Lib/sqlite3/__main__.py
+++ b/Lib/sqlite3/__main__.py
@@ -61,7 +61,7 @@ def runsource(self, source, filename="", symbol="single"):
if source[0] == ".":
match source[1:].strip():
case "version":
- print(f"{sqlite3.sqlite_version}")
+ print(sqlite3.sqlite_version)
case "help":
print("Enter SQL code and press enter.")
case "quit":
@@ -70,8 +70,8 @@ def runsource(self, source, filename="", symbol="single"):
pass
case _ as unknown:
t = theme.traceback
- self.write(f'{t.type}Error{t.reset}:{t.message} unknown'
- f'command or invalid arguments: "{unknown}".\n{t.reset}')
+ self.write(f'{t.type}Error{t.reset}: {t.message}unknown '
+ f'command: "{unknown}"{t.reset}\n')
else:
if not sqlite3.complete_statement(source):
return True
diff --git a/Lib/test/test_sqlite3/test_cli.py b/Lib/test/test_sqlite3/test_cli.py
index 37e0f74f688659..112501b05f2c06 100644
--- a/Lib/test/test_sqlite3/test_cli.py
+++ b/Lib/test/test_sqlite3/test_cli.py
@@ -130,7 +130,7 @@ def test_interact_dot_commands_unknown(self):
self.assertEndsWith(out, self.PS1)
self.assertEqual(out.count(self.PS1), 2)
self.assertEqual(out.count(self.PS2), 0)
- self.assertIn("Error", err)
+ self.assertIn('Error: unknown command: "', err)
# test "unknown_command" is pointed out in the error message
self.assertIn("unknown_command", err)