prevent a hen/egg problem when handling unsupported python versions

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
remotes/origin/2.0
Steven Armstrong 13 years ago
parent 995e2c44ee
commit f795b83c8e
  1. 12
      bin/cdist

@ -194,6 +194,13 @@ if __name__ == "__main__":
# Sys is needed for sys.exit()
import sys
cdistpythonversion = '3.2'
if sys.version < cdistpythonversion:
print('Cdist requires Python >= ' + cdistpythonversion +
' on the source host.', file=sys.stderr)
sys.exit(1)
exit_code = 0
try:
@ -201,11 +208,6 @@ if __name__ == "__main__":
import os
import re
cdistpythonversion = '3.2'
if sys.version < cdistpythonversion:
raise cdist.Error('Cdist requires Python >= ' + cdistpythonversion +
' on the source host.')
# Ensure our /lib/ is included into PYTHON_PATH
sys.path.insert(0, os.path.abspath(
os.path.join(os.path.dirname(os.path.realpath(__file__)), '../lib')))

Loading…
Cancel
Save