Handle OSError: out of pty devices

This commit is contained in:
Sean Davis 2018-08-06 18:16:54 -04:00
parent fbe0a5bb6d
commit 0889105a68
1 changed files with 11 additions and 7 deletions

View File

@ -48,13 +48,17 @@ def check_dependencies(commands=[]):
return False
# Check for LANG requirements
child = env_spawn('sudo', ['-v'], 1)
if child.expect([".*ssword.*", "Sorry",
pexpect.EOF,
pexpect.TIMEOUT]) == 3:
global use_env
use_env = True
child.close()
try:
child = env_spawn('sudo', ['-v'], 1)
if child.expect([".*ssword.*", "Sorry",
pexpect.EOF,
pexpect.TIMEOUT]) == 3:
global use_env
use_env = True
child.close()
except OSError:
child.close()
return False
# Check for sudo rights
child = env_spawn('sudo', ['-v'], 1)