summaryrefslogtreecommitdiffstats
path: root/QMTest
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-04-06 23:13:36 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2017-04-06 23:13:36 (GMT)
commit9b49fabea61340c856b18151224603e3162c84d3 (patch)
tree5c253a477ad581049d08d766dd3e2c997fbec445 /QMTest
parent8b4b7860340e1348ec00587a0c79007531e361d5 (diff)
downloadSCons-9b49fabea61340c856b18151224603e3162c84d3.zip
SCons-9b49fabea61340c856b18151224603e3162c84d3.tar.gz
SCons-9b49fabea61340c856b18151224603e3162c84d3.tar.bz2
py2/3 fix test logic to handle bytes vs strings when matching
Diffstat (limited to 'QMTest')
-rw-r--r--QMTest/TestCmd.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/QMTest/TestCmd.py b/QMTest/TestCmd.py
index 07a3905..3b745f8 100644
--- a/QMTest/TestCmd.py
+++ b/QMTest/TestCmd.py
@@ -453,13 +453,17 @@ def pass_test(self = None, condition = 1, function = None):
sys.exit(0)
-def match_exact(lines = None, matches = None):
+def match_exact(lines = None, matches = None, newline = '\n'):
"""
"""
+
+ if isinstance(lines, bytes) or bytes is str:
+ newline = to_bytes('\n')
+
if not is_List(lines):
- lines = lines.split("\n")
+ lines = lines.split(newline)
if not is_List(matches):
- matches = matches.split("\n")
+ matches = matches.split(newline)
if len(lines) != len(matches):
return
for i in range(len(lines)):