diff options
author | William Deegan <bill@baddogconsulting.com> | 2017-04-06 16:13:36 -0700 |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2017-04-06 16:13:36 -0700 |
commit | fccecb3ab51b9a637708aea351e8071cf3c05578 (patch) | |
tree | 5c253a477ad581049d08d766dd3e2c997fbec445 /QMTest | |
parent | b7216642c6e6abead2023949b687d229e756b801 (diff) | |
download | scons-fccecb3ab51b9a637708aea351e8071cf3c05578.tar.gz |
py2/3 fix test logic to handle bytes vs strings when matching
Diffstat (limited to 'QMTest')
-rw-r--r-- | QMTest/TestCmd.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/QMTest/TestCmd.py b/QMTest/TestCmd.py index 07a39056..3b745f85 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)): |