wow-addon-updater icon indicating copy to clipboard operation
wow-addon-updater copied to clipboard

python version incompatibility

Open ilu33 opened this issue 2 years ago • 4 comments

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?

ilu33 avatar Jan 01 '23 23:01 ilu33

Thanks, this was a recent feature developed by a 3.10 user. I'll have to backport it to maintain compatibility.

grrttedwards avatar Jan 01 '23 23:01 grrttedwards

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 :-(

ilu33 avatar Jan 02 '23 00:01 ilu33

if credentials:
  token = credentials.get("token")
  if token:
    self.headers["authorization"] = f"token {token}"

?

ilu33 avatar Jan 02 '23 03:01 ilu33

Changed the code as shown above and program is running without errors again. Haven't tested the github token stuff though.

ilu33 avatar Jan 19 '23 04:01 ilu33