Make build.py compatible with Python 2.6
Merge pull request #1447 from probins/build

Make build.py compatible with Python 2.6