Assert proc.stdin and proc.stdout
@@ -185,7 +185,8 @@ def call_subprocess(
stderr=subprocess.STDOUT, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, cwd=cwd, env=env,
)
- if proc.stdin:
+ assert proc.stdin
+ assert proc.stdout
proc.stdin.close()
except Exception as exc:
if log_failed_cmd:
@@ -196,8 +197,6 @@ def call_subprocess(
all_output = []
while True:
# The "line" value is a unicode string in Python 2.
- line = None
- if proc.stdout:
line = console_to_str(proc.stdout.readline())
if not line:
break
