Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Syntax errors" regardless of python version used #15

Open
dhasial opened this issue Dec 10, 2021 · 5 comments
Open

"Syntax errors" regardless of python version used #15

dhasial opened this issue Dec 10, 2021 · 5 comments

Comments

@dhasial
Copy link

dhasial commented Dec 10, 2021

This is on Debian Sid, so technically unsupported regardless, but perhaps the fix will be something simple.

When using either python which seems to be the correct python version based on the README, or python3, I get syntax errors, yet they're different depending on the version of python used. I don't know python well enough yet to say why this is happening, but perhaps you'll have an idea.

python == Python 2.7.18

  File "req.py", line 11
    print = functools.partial(print, flush=True)
          ^
SyntaxError: invalid syntax

python3 == Python 3.9.9

python3 req.py
  File "/home/valence/src/KelloggBot/req.py", line 75
    match key:
          ^
SyntaxError: invalid syntax
@Egarok
Copy link

Egarok commented Dec 10, 2021

Match statements require Python 3.10 or newer:
https://www.pythonpool.com/match-case-python/

I just changed it to if-elif statements since I am using Python 3.8

@joeyagreco
Copy link
Contributor

What @Egarok said... use Python 3.10 and that should fix it.

@ChrisCoe
Copy link
Contributor

@bolshoytoster has PR #35 which should help with python 2 support.

@bolshoytoster
Copy link
Contributor

@ChrisCoe cheers, I've fixed the 'print = functools.partial(print, flush=True)' error and removed the match statements. It should hopefully work for python2 if you clone my fork (https://github.com/bolshoytoster/KelloggBot).

@bolshoytoster
Copy link
Contributor

I’ve merged my fork with @pws1453‘s (#25). Clone that if you need python2 support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants