happyleavesaoc / aoc-mgz

Age of Empires II recorded game parsing and summarization in Python 3.
MIT License
197 stars 42 forks source link

SyntaxError: can't use starred expression here #57

Closed jchmb closed 3 years ago

jchmb commented 3 years ago

With Python 3.9 this throws a syntax error. It seems to work fine with Python 3.6, however.

Traceback (most recent call last):
  File "(removed)\test.py", line 1, in <module>
    from mgz.model import parse_match
  File "(removed)\LocalCache\local-packages\Python39\site-packages\mgz\model\__init__.py", line 8, in <module>
    from mgz.fast.header import parse
  File "(removed)\LocalCache\local-packages\Python39\site-packages\mgz\fast\header.py", line 108
    type_, (*diplomacy), name_length = unpack(f'<bx{num_players}x9i5xh', header)
            ^
SyntaxError: can't use starred expression here

When I change the line to the version below it works with both Python versions.

type_, *diplomacy, name_length = unpack(f'<bx{num_players}x9i5xh', header)
happyleavesaoc commented 3 years ago

Fixed @ https://github.com/happyleavesaoc/aoc-mgz/pull/58