wow-addon-updater
wow-addon-updater copied to clipboard
python version incompatibility
Describe the bug Python exception
If you run pipenv update
on the command line and try again, does the issue go away?
No
Log output
File "~/bin/wow-addon-updater/updater/site/github_release.py", line 18
if credentials and (token := credentials.get("token")):
^
SyntaxError: invalid syntax
Python from version 3.8 can read this. But not everybody has this version. Please keep things compatible for a while. What do I need to replace := with for python v. 3.73?
Thanks, this was a recent feature developed by a 3.10 user. I'll have to backport it to maintain compatibility.
I tried to convert with python-walrus but ran into another exception.
File "~/.local/lib/python3.7/site-packages/walrus.py", line 524, in _process_funcdef
func_def, func_name, func_param, func_op, func_suite = node.children
ValueError: too many values to unpack (expected 5)
So no help to be had without really understanding the code :-(
if credentials:
token = credentials.get("token")
if token:
self.headers["authorization"] = f"token {token}"
?
Changed the code as shown above and program is running without errors again. Haven't tested the github token stuff though.