[master][PATCH] Don't rely on Gtk being importable for exception handling

Vratislav Podzimek vpodzime at redhat.com
Mon Dec 9 13:49:32 UTC 2013


The anaconda-core package doesn't require Gtk to be installed. If it fails to be
imported, it means for us the same as if fails to be initialized.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 pyanaconda/exception.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pyanaconda/exception.py b/pyanaconda/exception.py
index e61cce0..f97407a 100644
--- a/pyanaconda/exception.py
+++ b/pyanaconda/exception.py
@@ -116,7 +116,7 @@ class AnacondaExceptionHandler(ExceptionHandler):
                     super(AnacondaExceptionHandler, self).handleException(
                                                             dump_info)
 
-            except RuntimeError:
+            except (RuntimeError, ImportError):
                 log.debug("Gtk cannot be initialized")
                 # X not running (Gtk cannot be initialized)
                 if threadMgr.in_main_thread():
-- 
1.8.4.2



More information about the anaconda-patches mailing list