You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python 3 has more restrictive scoping rules that Python 2 so a variable created inside of a list comprehension is not available outside of that list comprehension.
flake8 testing of https://github.com/ggtracker/sc2reader on Python 3.6.3
$ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__
```
./sc2reader/scripts/sc2parse.py:48:25: F821 undefined name 'human'
human.pids = set([human.pid for human in replay.humans])
^
./sc2reader/scripts/sc2parse.py:52:28: F821 undefined name 'human'
if human.pids != event_pids:
^
./sc2reader/scripts/sc2parse.py:53:109: F821 undefined name 'human'
print('Event Pid problem! pids={pids} but event pids={event_pids}'.format(pids=human.pids, event_pids=event_pids))
^
3 F821 undefined name 'human'
3
```
This PR creates a new __human_pids__ to hold the set of all __replay.humans.pids__ instead of modifying the pid of the last human in that list.
0 commit comments