diff options
author | Jane Doe <jdoe@example.com> | 2017-05-28 22:23:30 (GMT) |
---|---|---|
committer | Jane Doe <jdoe@example.com> | 2017-05-28 22:23:30 (GMT) |
commit | 20a45727ec1023102f376a5c71d838a3ec8a9b1c (patch) | |
tree | cf624d8acd5a4e8d48112d9b286973e36160ce85 /QMTest | |
parent | d589b53b2875a1bf49bb9e52dba9deba4ef96243 (diff) | |
download | SCons-20a45727ec1023102f376a5c71d838a3ec8a9b1c.zip SCons-20a45727ec1023102f376a5c71d838a3ec8a9b1c.tar.gz SCons-20a45727ec1023102f376a5c71d838a3ec8a9b1c.tar.bz2 |
PY2/3 handle stderr/stdout streams which are None
Diffstat (limited to 'QMTest')
-rw-r--r-- | QMTest/TestCmd.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/QMTest/TestCmd.py b/QMTest/TestCmd.py index 0e7bc51..e4c69a6 100644 --- a/QMTest/TestCmd.py +++ b/QMTest/TestCmd.py @@ -1448,7 +1448,10 @@ class TestCmd(object): TODO: Do we need to pass universal newlines into this function? """ - if sys.version_info[0] == 3 and sys.version_info[1] < 6: + + if not stream: + return stream + elif sys.version_info[0] == 3 and sys.version_info[1] < 6: stream = stream.decode('utf-8') stream = stream.replace('\r\n', '\n') elif sys.version_info[0] == 2: |