From 9e8c4d9a22c8d2a64a75989b53e71ab7e49fa30b Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Mon, 20 Jan 2014 15:08:35 +0000 Subject: [PATCH] Don't crash when failing to manually launch an application --- usr/lib/linuxmint/mintMenu/plugins/execute.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/execute.py b/usr/lib/linuxmint/mintMenu/plugins/execute.py index cdbed90..e4182d9 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/execute.py +++ b/usr/lib/linuxmint/mintMenu/plugins/execute.py @@ -24,9 +24,13 @@ def Execute( cmd , commandCwd=None): if isinstance( cmd, str ) or isinstance( cmd, unicode): if (cmd.find("/home/") >= 0) or (cmd.find("su-to-root") >= 0) or (cmd.find("\"") >= 0): print "running manually..." - os.chdir(cwd) - os.system(cmd + " &") - return True + try: + os.chdir(cwd) + os.system(cmd + " &") + return True + except Exception, detail: + print detail + return False cmd = cmd.split() cmd = RemoveArgs(cmd)