From fea0fcf876979599cf4a537f0cc0c0c5b3182117 Mon Sep 17 00:00:00 2001 From: Mikhail Gordeev Date: Mon, 6 Apr 2020 23:15:16 +0300 Subject: [PATCH] Fix type error cloud-build.py:173: error: Item "None" of "Optional[IO[bytes]]" has no attribute "read" --- cloud-build.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cloud-build.py b/cloud-build.py index 9c1fc11..500558c 100755 --- a/cloud-build.py +++ b/cloud-build.py @@ -170,7 +170,8 @@ class CB: rc = p.wait() maybe_fail(string, rc) with open(stdout_to_file, 'w') as f: - f.write(p.stdout.read().decode()) + if p.stdout: + f.write(p.stdout.read().decode()) else: rc = subprocess.call(cmd) maybe_fail(string, rc)