Handle OSError: out of pty devices
This commit is contained in:
parent
fbe0a5bb6d
commit
0889105a68
|
@ -48,13 +48,17 @@ def check_dependencies(commands=[]):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Check for LANG requirements
|
# Check for LANG requirements
|
||||||
child = env_spawn('sudo', ['-v'], 1)
|
try:
|
||||||
if child.expect([".*ssword.*", "Sorry",
|
child = env_spawn('sudo', ['-v'], 1)
|
||||||
pexpect.EOF,
|
if child.expect([".*ssword.*", "Sorry",
|
||||||
pexpect.TIMEOUT]) == 3:
|
pexpect.EOF,
|
||||||
global use_env
|
pexpect.TIMEOUT]) == 3:
|
||||||
use_env = True
|
global use_env
|
||||||
child.close()
|
use_env = True
|
||||||
|
child.close()
|
||||||
|
except OSError:
|
||||||
|
child.close()
|
||||||
|
return False
|
||||||
|
|
||||||
# Check for sudo rights
|
# Check for sudo rights
|
||||||
child = env_spawn('sudo', ['-v'], 1)
|
child = env_spawn('sudo', ['-v'], 1)
|
||||||
|
|
Loading…
Reference in New Issue