summaryrefslogtreecommitdiff
path: root/QMTest
diff options
context:
space:
mode:
authorJane Doe <jdoe@example.com>2017-05-28 15:23:30 -0700
committerJane Doe <jdoe@example.com>2017-05-28 15:23:30 -0700
commit874188e188992834737935a4be97dbb98c093433 (patch)
treecf624d8acd5a4e8d48112d9b286973e36160ce85 /QMTest
parent67b90de036ea90875d88c3f7cac10b61c9af796e (diff)
downloadscons-874188e188992834737935a4be97dbb98c093433.tar.gz
PY2/3 handle stderr/stdout streams which are None
Diffstat (limited to 'QMTest')
-rw-r--r--QMTest/TestCmd.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/QMTest/TestCmd.py b/QMTest/TestCmd.py
index 0e7bc514..e4c69a6e 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: