summaryrefslogtreecommitdiffstats
path: root/QMTest/TestCmd.py
diff options
context:
space:
mode:
authorJane Doe <jdoe@example.com>2017-05-28 00:43:03 (GMT)
committerJane Doe <jdoe@example.com>2017-05-28 00:43:03 (GMT)
commit8c2bfc326ce26ff3f3f10dee5adee2d9a6a0c514 (patch)
treedc334093fb5d507a2272f8849d0a4d0435dde042 /QMTest/TestCmd.py
parente3fc763d794af337b7fcb4ca2d1e2018a0831183 (diff)
downloadSCons-8c2bfc326ce26ff3f3f10dee5adee2d9a6a0c514.zip
SCons-8c2bfc326ce26ff3f3f10dee5adee2d9a6a0c514.tar.gz
SCons-8c2bfc326ce26ff3f3f10dee5adee2d9a6a0c514.tar.bz2
py2/3 in test.read, if using py3 and not binary, then allow specifying what to do with newline. PY3 will automatically translate it which can yield \r\r\n's in files
Diffstat (limited to 'QMTest/TestCmd.py')
-rw-r--r--QMTest/TestCmd.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/QMTest/TestCmd.py b/QMTest/TestCmd.py
index cc8e69a..aec51d0 100644
--- a/QMTest/TestCmd.py
+++ b/QMTest/TestCmd.py
@@ -1245,7 +1245,7 @@ class TestCmd(object):
file = self.canonicalize(file)
if mode[0] != 'r':
raise ValueError("mode must begin with 'r'")
- if PY3:
+ if PY3 and 'b' not in mode:
return open(file, mode, newline=newline).read()
else:
return open(file, mode).read()