catch nonexistent command even if conffile matches

This commit is contained in:
Radovan Garabík 2017-05-21 16:00:34 +02:00
parent 8fe23efe77
commit e10d7d257f
1 changed files with 5 additions and 1 deletions

6
grc
View File

@ -137,7 +137,11 @@ if cfile != "" and colour:
os.dup2(chie, 2)
os.close(choe)
os.close(chie)
os.execvp(args[0], args)
try:
os.execvp(args[0], args)
except OSError as e:
sys.stderr.write('grc: %s: %s\n' % (args[0], e.strerror))
sys.exit(1)
if stdoutff: