diff --git a/tools/check/check_python b/tools/check/check_python index e56f5a9684..6d665ea4b2 100755 --- a/tools/check/check_python +++ b/tools/check/check_python @@ -3,7 +3,10 @@ RC=0 -python -V 2>&1 | cut -d ' ' -f 2 | grep -q '^2.[2345]' || RC=1 +python -c ' +import sys +sys.exit(sys.version_info[0] < 2 or sys.version_info[1] < 2) +' || RC=1 if test ${RC} -ne 0; then echo diff --git a/tools/check/check_python_xml b/tools/check/check_python_xml index 95174f4688..de9ebac09c 100755 --- a/tools/check/check_python_xml +++ b/tools/check/check_python_xml @@ -1,11 +1,7 @@ #!/bin/bash # CHECK-INSTALL -function error { - echo - echo " *** Check for python-xml package FAILED" - exit 1 -} +RC=0 python -c ' import os.path, sys @@ -13,4 +9,11 @@ for p in sys.path: if os.path.exists(p + "/xml/dom/minidom.py"): sys.exit(0) sys.exit(1) -' || error +' || RC=1 + +if test ${RC} -ne 0; then + echo + echo " *** Check for python-xml package FAILED" +fi + +exit ${RC}