pylookup.py: migrate to python3