Fix type error

cloud-build.py:173: error: Item "None" of "Optional[IO[bytes]]" has no
attribute "read"
This commit is contained in:
Mikhail Gordeev 2020-04-06 23:15:16 +03:00
parent 7206de1f74
commit fea0fcf876

View File

@ -170,7 +170,8 @@ class CB:
rc = p.wait() rc = p.wait()
maybe_fail(string, rc) maybe_fail(string, rc)
with open(stdout_to_file, 'w') as f: with open(stdout_to_file, 'w') as f:
f.write(p.stdout.read().decode()) if p.stdout:
f.write(p.stdout.read().decode())
else: else:
rc = subprocess.call(cmd) rc = subprocess.call(cmd)
maybe_fail(string, rc) maybe_fail(string, rc)