diff options
author | Jaroslav Skarvada | 2012-04-23 10:51:36 -0700 |
---|---|---|
committer | Johnathan Corgan | 2012-04-23 10:54:00 -0700 |
commit | 70392d37c572ee94ff7a72e35e02f11404c532fd (patch) | |
tree | edce5e9ed2c7fe2fcd7aa93959146badec1662b4 /cmake/Modules | |
parent | b40ccb1d3f12a6837df235ccbceee5180c711efa (diff) | |
download | gnuradio-70392d37c572ee94ff7a72e35e02f11404c532fd.tar.gz gnuradio-70392d37c572ee94ff7a72e35e02f11404c532fd.tar.bz2 gnuradio-70392d37c572ee94ff7a72e35e02f11404c532fd.zip |
cmake: fix pygtk check failure with no X session
This change makes python module checking more robust by preventing
cmake failure when unexpected exceptions occur.
Diffstat (limited to 'cmake/Modules')
-rw-r--r-- | cmake/Modules/GrPython.cmake | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/cmake/Modules/GrPython.cmake b/cmake/Modules/GrPython.cmake index eff9cbcdc..14f2b29cd 100644 --- a/cmake/Modules/GrPython.cmake +++ b/cmake/Modules/GrPython.cmake @@ -76,12 +76,11 @@ macro(GR_PYTHON_CHECK_MODULE desc mod cmd have) execute_process( COMMAND ${PYTHON_EXECUTABLE} -c " ######################################### -try: import ${mod} -except: - try: ${mod} - except: exit(-1) -try: assert ${cmd} -except: exit(-1) +try: + import ${mod} + assert ${cmd} +except ImportError, AssertionError: exit(-1) +except: pass #########################################" RESULT_VARIABLE ${have} ) |