| 1 | import os, sys |
|---|
| 2 | |
|---|
| 3 | msg = """ERROR: Your Python version is: %s |
|---|
| 4 | Galaxy is currently supported on Python 2.4, 2.5 and 2.6. To run Galaxy, |
|---|
| 5 | please download and install a supported version from python.org. If a |
|---|
| 6 | supported version is installed but is not your default, getgalaxy.org |
|---|
| 7 | contains instructions on how to force Galaxy to use a different version.""" % sys.version[:3] |
|---|
| 8 | |
|---|
| 9 | def check_python(): |
|---|
| 10 | try: |
|---|
| 11 | assert sys.version_info[:2] >= ( 2, 4 ) and sys.version_info[:2] <= ( 2, 6 ) |
|---|
| 12 | except AssertionError: |
|---|
| 13 | print >>sys.stderr, msg |
|---|
| 14 | raise |
|---|
| 15 | |
|---|
| 16 | if __name__ == '__main__': |
|---|
| 17 | rval = 0 |
|---|
| 18 | try: |
|---|
| 19 | check_python() |
|---|
| 20 | except StandardError: |
|---|
| 21 | rval = 1 |
|---|
| 22 | sys.exit( rval ) |
|---|