Don't crash when failing to manually launch an application

This commit is contained in:
Clement Lefebvre 2014-01-20 15:08:35 +00:00
parent 62bee525c8
commit 9e8c4d9a22

View File

@ -24,9 +24,13 @@ def Execute( cmd , commandCwd=None):
if isinstance( cmd, str ) or isinstance( cmd, unicode): if isinstance( cmd, str ) or isinstance( cmd, unicode):
if (cmd.find("/home/") >= 0) or (cmd.find("su-to-root") >= 0) or (cmd.find("\"") >= 0): if (cmd.find("/home/") >= 0) or (cmd.find("su-to-root") >= 0) or (cmd.find("\"") >= 0):
print "running manually..." print "running manually..."
try:
os.chdir(cwd) os.chdir(cwd)
os.system(cmd + " &") os.system(cmd + " &")
return True return True
except Exception, detail:
print detail
return False
cmd = cmd.split() cmd = cmd.split()
cmd = RemoveArgs(cmd) cmd = RemoveArgs(cmd)