Skip to content

Commit 2372e55

Browse files
Assert that an output stream is available when we expect it (#541)
A new version of pytype will begin erroring on this. Add an assertion so pytype can assume that p.stdout is not None in this case.
1 parent 1fdf038 commit 2372e55

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler_opt/rl/compilation_runner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ def start_cancellable_process(cmdline: list[str],
258258
raise subprocess.CalledProcessError(retcode, cmdline)
259259
else:
260260
if want_output:
261+
assert p.stdout is not None
261262
ret: bytes = p.stdout.read()
262263
p.stdout.close()
263264
return ret

0 commit comments

Comments
 (0)