Why do I get "SyntaxError: invalid syntax" when using `match` in Python?

Viewed 1260

I tried to run a Python script using

python3 ds_main.py

but it returns the error:

Traceback (most recent call last):
  File "ds_main.py", line 14 in <module>
    import cmd_main
  File "/home/me/discord/cmd_main.py", line 190
    match action:
          ^
SyntaxError: invalid syntax

In this section, I did add a match case clause, which the error seems to be pointing to.

I checked the version using python3 --version which returns Python 3.8.10.

1 Answers
Related