mirror of
https://github.com/ARM-software/devlib.git
synced 2025-02-24 05:27:50 +00:00
utils/check_output: Ensure output
and error
are always initialised.
Ensure that the `output` and `error` variables are always initialised regardless of whether an error occurs during execution.
This commit is contained in:
parent
b9d50ec164
commit
3c28c280de
@ -177,6 +177,8 @@ def check_output(command, timeout=None, ignore=None, inputtext=None, **kwargs):
|
|||||||
preexec_fn=preexec_function,
|
preexec_fn=preexec_function,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
|
output = None
|
||||||
|
error = None
|
||||||
try:
|
try:
|
||||||
output, error = process.communicate(inputtext, timeout=timeout)
|
output, error = process.communicate(inputtext, timeout=timeout)
|
||||||
except subprocess.TimeoutExpired as e:
|
except subprocess.TimeoutExpired as e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user