Fail more gracefully when running on python < v2.0
This commit is contained in:
parent
07ab0ae773
commit
7a20db7588
21
setup.py
21
setup.py
|
@ -1,12 +1,23 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from distutils.core import setup
|
|
||||||
|
|
||||||
# check version
|
def check_python_version():
|
||||||
if sys.version_info[0] < 2:
|
"""Abort if we are running on python < v2.0"""
|
||||||
print "Python versions below 2.0 not supported"
|
too_old_error = "This program requires python v2.0 or greater."
|
||||||
sys.exit(1)
|
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",
|
setup(name="archivemail",
|
||||||
version="0.3.0",
|
version="0.3.0",
|
||||||
|
|
Loading…
Reference in New Issue