summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2018-08-16 13:36:05 +0100
committerEmil Velikov <[email protected]>2018-08-23 11:59:48 +0100
commite7149369bdce50e8db5641e9b92799b26727b31a (patch)
tree8c766bc4b9f84e62f10fdc73992b79123420495f
parentdf2042d99ac54f8639f123c8586d9cadcfbb5521 (diff)
configure: use distutils in ax_check_python_mako_module
Handling the version comparison by hand is a bad idea. Python has a handy module distutils for that - use it. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
-rw-r--r--m4/ax_check_python_mako_module.m45
1 files changed, 3 insertions, 2 deletions
diff --git a/m4/ax_check_python_mako_module.m4 b/m4/ax_check_python_mako_module.m4
index 7d9bb511c09..1d293d821c3 100644
--- a/m4/ax_check_python_mako_module.m4
+++ b/m4/ax_check_python_mako_module.m4
@@ -45,11 +45,12 @@ AC_DEFUN([AX_CHECK_PYTHON_MAKO_MODULE],
try:
import sys
import mako
+ import distutils.version
except ImportError as err:
sys.exit(err)
else:
- ver_req = map(int, '$1'.split('.'))
- ver_act = map(int, mako.__version__.split('.'))
+ ver_req = distutils.version.LooseVersion('$1')
+ ver_act = distutils.version.LooseVersion(mako.__version__)
sys.exit(int(ver_req > ver_act))
" | $PYTHON2 -