use sys.version_info[0] to support python 2.6

Python 2.6 apparently doesn't support sys.version_info.major, but this
works just as well.