[gnome-shell] More gracefully handle a situation where starting shell failed



commit 42e3a93c2080625ba5c24672c668373ca5ea15c6
Author: Colin Walters <walters verbum org>
Date:   Wed Sep 9 15:49:31 2009 -0400

    More gracefully handle a situation where starting shell failed
    
    If start_shell() threw an exception before, we'd overwrite it with
    an exception in the finally() clause.  Handle this and just print a message
    and let the exception propagate.

 src/gnome-shell.in |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/gnome-shell.in b/src/gnome-shell.in
index 035ccd3..2acc967 100644
--- a/src/gnome-shell.in
+++ b/src/gnome-shell.in
@@ -253,6 +253,7 @@ if options.debug:
 normal_exit = False
 
 try:
+    shell = None
     if options.xephyr:
         xephyr = start_xephyr()
         # This makes us not grab the org.gnome.Panel name
@@ -281,7 +282,9 @@ finally:
         except OSError:
             pass
 
-    if shell.returncode ==  0:
+    if shell is None:
+        print "Failed to start shell"
+    elif shell.returncode == 0:
         normal_exit = True
         if options.verbose:
             print "Shell exited normally"



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