Handle non-existent child process
This commit is contained in:
parent
0889105a68
commit
dceb04ebe7
|
@ -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,6 +58,7 @@ def check_dependencies(commands=[]):
|
||||||
use_env = True
|
use_env = True
|
||||||
child.close()
|
child.close()
|
||||||
except OSError:
|
except OSError:
|
||||||
|
if child is not None:
|
||||||
child.close()
|
child.close()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue