Use sys.version_info[0] instead of sys.version_info.major for Python 2.6 compatibility (suggested by combacsa).