[ocrfeeder] Try to find the Python modules instead of importing them on build time



commit 3e282819cff6f9a93f8977d398a17ae0fb65c06f
Author: Moritz Barsnick <moritz barsnick net>
Date:   Fri Jan 20 20:12:38 2012 +0100

    Try to find the Python modules instead of importing them on build time
    
    This avoids the issue of some modules trying to open a display, like
    importing gtk, which will make the build fail under certain scenarios
    (like generating an RPM package).

 m4/m4_ax_python_module.m4 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/m4/m4_ax_python_module.m4 b/m4/m4_ax_python_module.m4
index bd70a06..c21eabe 100644
--- a/m4/m4_ax_python_module.m4
+++ b/m4/m4_ax_python_module.m4
@@ -31,7 +31,7 @@ AC_DEFUN([AX_PYTHON_MODULE],[
     fi
     PYTHON_NAME=`basename $PYTHON`
     AC_MSG_CHECKING($PYTHON_NAME module: $1)
-	$PYTHON -c "import $1" 2>/dev/null
+	$PYTHON -c "import imp; imp.find_module(\"$1\")" 2>/dev/null
 	if test $? -eq 0;
 	then
 		AC_MSG_RESULT(yes)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]