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.
This commit is contained in:
Colin Walters 2009-09-09 15:49:31 -04:00
parent 05812ef7f9
commit 42e3a93c20

View File

@ -253,6 +253,7 @@ if options.debug:
normal_exit = False normal_exit = False
try: try:
shell = None
if options.xephyr: if options.xephyr:
xephyr = start_xephyr() xephyr = start_xephyr()
# This makes us not grab the org.gnome.Panel name # This makes us not grab the org.gnome.Panel name
@ -281,7 +282,9 @@ finally:
except OSError: except OSError:
pass pass
if shell.returncode == 0: if shell is None:
print "Failed to start shell"
elif shell.returncode == 0:
normal_exit = True normal_exit = True
if options.verbose: if options.verbose:
print "Shell exited normally" print "Shell exited normally"