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.
This commit is contained in:
parent
2ea5012535
commit
22835b35e7
@ -11,6 +11,7 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import time
|
import time
|
||||||
|
import errno
|
||||||
|
|
||||||
def find_cmd (cmd_list):
|
def find_cmd (cmd_list):
|
||||||
"""
|
"""
|
||||||
@ -70,10 +71,17 @@ def start_xephyr():
|
|||||||
raise RuntimeError("xauth failed")
|
raise RuntimeError("xauth failed")
|
||||||
|
|
||||||
# Launch Xephyr
|
# Launch Xephyr
|
||||||
|
try:
|
||||||
xephyr = subprocess.Popen(["Xephyr", display,
|
xephyr = subprocess.Popen(["Xephyr", display,
|
||||||
"-auth", xauth_file,
|
"-auth", xauth_file,
|
||||||
"-screen", options.geometry,
|
"-screen", options.geometry,
|
||||||
"-host-cursor"])
|
"-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['DISPLAY'] = display
|
||||||
os.environ['XAUTHORITY'] = xauth_file
|
os.environ['XAUTHORITY'] = xauth_file
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user