diff options
author | Paul Rodger <paul@paulrodger.com> | 2002-04-11 10:31:07 +0000 |
---|---|---|
committer | Paul Rodger <paul@paulrodger.com> | 2002-04-11 10:31:07 +0000 |
commit | 7a20db75884209f6dd5ce0ffe8a9c5dc596976d0 (patch) | |
tree | 18e341b3dd513f35590caa8f5ddd0cb5af3074e5 | |
parent | 07ab0ae7731d957b6f835d8e7789ff4c0aa0302f (diff) | |
download | archivemail-7a20db75884209f6dd5ce0ffe8a9c5dc596976d0.tar.gz archivemail-7a20db75884209f6dd5ce0ffe8a9c5dc596976d0.tar.bz2 archivemail-7a20db75884209f6dd5ce0ffe8a9c5dc596976d0.zip |
Fail more gracefully when running on python < v2.0
-rwxr-xr-x | setup.py | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -1,12 +1,23 @@ #!/usr/bin/env python import sys -from distutils.core import setup -# check version -if sys.version_info[0] < 2: - print "Python versions below 2.0 not supported" - sys.exit(1) +def check_python_version(): + """Abort if we are running on python < v2.0""" + too_old_error = "This program requires python v2.0 or greater." + try: + version = sys.version_info # we might not even have this function! :) + if (version[0] < 2): + print too_old_error + sys.exit(1) + except AttributeError: + print too_old_error + sys.exit(1) + +check_python_version() # define & run this early because 'distutils.core' is new + + +from distutils.core import setup setup(name="archivemail", version="0.3.0", |