BUILD_INDEX.py: migrate to python3