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