Fix Python 2.6 compatibility

sys.version_info.major added in version 2.7