Skip to content

Commit bb0c7d9

Browse files
committed
Use as-patern to capture the unknow command
1 parent b473fe9 commit bb0c7d9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/sqlite3/__main__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ def runsource(self, source, filename="<input>", symbol="single"):
5858
print("Enter SQL code and press enter.")
5959
case "quit":
6060
sys.exit(0)
61-
case _:
62-
print('Error: unknown command or invalid arguments: '
63-
f'"{source[1:].strip()}". Enter ".help" for help')
61+
case _ as unknown:
62+
print("Error: unknown command or invalid arguments: "
63+
f'"{unknown}". Enter ".help" for help')
6464
else:
6565
if not sqlite3.complete_statement(source):
6666
return True

0 commit comments

Comments
 (0)