major, minor, micro, releaselevel, serial = sys.version_info
if (major, minor) <= (2, 5):
    sys.exit(2)
How to gracefully deal with failed future feature (__future__) imports due to old interpreter version?