Handle non-existent child process

This commit is contained in:
Sean Davis 2018-08-06 18:18:09 -04:00
parent 0889105a68
commit dceb04ebe7
1 changed files with 3 additions and 1 deletions

View File

@ -48,6 +48,7 @@ def check_dependencies(commands=[]):
return False
# Check for LANG requirements
child = None
try:
child = env_spawn('sudo', ['-v'], 1)
if child.expect([".*ssword.*", "Sorry",
@ -57,6 +58,7 @@ def check_dependencies(commands=[]):
use_env = True
child.close()
except OSError:
if child is not None:
child.close()
return False