Show a nice error message when execing() the child fails
This commit is contained in:
@@ -68,7 +68,12 @@ def fork_child(argv, cwd, opts):
|
|||||||
os.environ['COLORTERM'] = 'truecolor'
|
os.environ['COLORTERM'] = 'truecolor'
|
||||||
if os.path.isdir(terminfo_dir):
|
if os.path.isdir(terminfo_dir):
|
||||||
os.environ['TERMINFO'] = terminfo_dir
|
os.environ['TERMINFO'] = terminfo_dir
|
||||||
os.execvp(argv[0], argv)
|
try:
|
||||||
|
os.execvp(argv[0], argv)
|
||||||
|
except Exception as err:
|
||||||
|
print('Could not launch:', argv[0])
|
||||||
|
print('\t', err)
|
||||||
|
input('\nPress Enter to exit:')
|
||||||
else:
|
else:
|
||||||
os.close(slave)
|
os.close(slave)
|
||||||
fork_child.pid = pid
|
fork_child.pid = pid
|
||||||
|
|||||||
Reference in New Issue
Block a user