From 22835b35e7e0685e870bc6d37f26afce2667c90c Mon Sep 17 00:00:00 2001 From: Siegfried Gevatter Date: Mon, 6 Apr 2009 16:10:03 +0200 Subject: [PATCH] Catch exception raised when Xephyr can't be found If Xephyr isn't installed currently src/gnome-shell raises an exception which isn't at all obvious without looking at the source. This commit catches the exception and replaces it with a more informative error message. --- src/gnome-shell.in | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/gnome-shell.in b/src/gnome-shell.in index abaec6a4a..a5dc96d08 100755 --- a/src/gnome-shell.in +++ b/src/gnome-shell.in @@ -11,6 +11,7 @@ import subprocess import sys import tempfile import time +import errno def find_cmd (cmd_list): """ @@ -70,10 +71,17 @@ def start_xephyr(): raise RuntimeError("xauth failed") # Launch Xephyr - xephyr = subprocess.Popen(["Xephyr", display, - "-auth", xauth_file, - "-screen", options.geometry, - "-host-cursor"]) + try: + xephyr = subprocess.Popen(["Xephyr", display, + "-auth", xauth_file, + "-screen", options.geometry, + "-host-cursor"]) + except OSError, e: + if e.errno == errno.ENOENT: + print "Could not find Xephyr." + sys.exit(1) + else: + raise os.environ['DISPLAY'] = display os.environ['XAUTHORITY'] = xauth_file