https://github.com/galaxyproject/galaxy
Raw File
Tip revision: 95daf69b372fa829325be561dc0a9907da0bea81 authored by Nate Coraor on 15 December 2016, 17:49:39 UTC
Merge branch 'release_15.07' into release_15.10
Tip revision: 95daf69
check_python.py
"""
If the current installed python version is not 2.6 to 2.7, prints an error
message to stderr and returns 1
"""

import sys

msg = """ERROR: Your Python version is: %s
Galaxy is currently supported on Python 2.6 and 2.7.  To run Galaxy,
please download and install a supported version from python.org.  If a
supported version is installed but is not your default, getgalaxy.org
contains instructions on how to force Galaxy to use a different version.""" % sys.version[:3]


def check_python():
    try:
        assert sys.version_info[:2] >= ( 2, 6 ) and sys.version_info[:2] <= ( 2, 7 )
    except AssertionError:
        print >>sys.stderr, msg
        raise

if __name__ == '__main__':
    rval = 0
    try:
        check_python()
    except StandardError:
        rval = 1
    sys.exit( rval )
back to top