fix a bug. use sys.version_info.major can't be used in Python2.5