Blob Blame History Raw
From 883a2abd5af5c96be894d5ef7ee6e9a2b8e64307 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenko@redhat.com>
Date: Tue, 14 Mar 2017 15:30:00 +0100
Subject: [PATCH] ax_python_devel: check success of import by return code
 rather than by stderr

In Python 3.7, when you have C locale it will be automatically coerced
to C.UTF-8 and warning will be printed to stderr. This breaks AX_PYTHON_DEVEL.

Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
---
 m4/ax_python_devel.m4 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/m4/ax_python_devel.m4 b/m4/ax_python_devel.m4
index d2d60c1..9487fad 100644
--- a/m4/ax_python_devel.m4
+++ b/m4/ax_python_devel.m4
@@ -67,7 +67,7 @@
 #   modified version of the Autoconf Macro, you may extend this special
 #   exception to the GPL to apply to your modified version as well.
 
-#serial 19
+#serial 20
 
 AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL])
 AC_DEFUN([AX_PYTHON_DEVEL],[
@@ -137,7 +137,7 @@ variable to configure. See ``configure --help'' for reference.
 	#
 	AC_MSG_CHECKING([for the distutils Python package])
 	ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
-	if test -z "$ac_distutils_result"; then
+	if test $? -eq 0; then
 		AC_MSG_RESULT([yes])
 	else
 		AC_MSG_RESULT([no])
-- 
2.12.0