diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2018-11-06 12:50:00 -0800 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-11-07 10:27:58 +0200 |
commit | e921e38301a54b111c7606aa30d718c856140e47 (patch) | |
tree | 0562dc2084d22edce1088cfffb5d286bad78933c | |
parent | 11e3011a6bf0adeb51582c590c90b0f4dccb4df8 (diff) | |
download | meson-e921e38301a54b111c7606aa30d718c856140e47.zip meson-e921e38301a54b111c7606aa30d718c856140e47.tar.gz meson-e921e38301a54b111c7606aa30d718c856140e47.tar.bz2 |
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
-rw-r--r-- | mesonbuild/mtest.py | 16 |
1 files changed, 10 insertions, 6 deletions
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 |