From e7149369bdce50e8db5641e9b92799b26727b31a Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Thu, 16 Aug 2018 13:36:05 +0100 Subject: [PATCH] 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 Reviewed-by: Dylan Baker --- m4/ax_check_python_mako_module.m4 | 5 +++-- 1 file 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 - -- 2.30.2