From e921e38301a54b111c7606aa30d718c856140e47 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 6 Nov 2018 12:50:00 -0800 Subject: mtest: Check that stdout is not None before seeking As can be the case if additional_error is None and verbose is used. Fixes #4470 --- mesonbuild/mtest.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'mesonbuild') diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py index 6c4cdb3..cee4c5a 100644 --- a/mesonbuild/mtest.py +++ b/mesonbuild/mtest.py @@ -371,13 +371,17 @@ class SingleTestRunner: endtime = time.time() duration = endtime - starttime if additional_error is None: - stdout.seek(0) - stdo = decode(stdout.read()) - if stderr != stdout: - stderr.seek(0) - stde = decode(stderr.read()) + if stdout is None: # if stdout is None stderr should be as well + stdo = '' + stde = '' else: - stde = "" + stdout.seek(0) + stdo = decode(stdout.read()) + if stderr != stdout: + stderr.seek(0) + stde = decode(stderr.read()) + else: + stde = "" else: stdo = "" stde = additional_error -- cgit v1.1