summaryrefslogtreecommitdiffstats
path: root/llvm/utils
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/utils')
-rw-r--r--llvm/utils/lit/lit/TestRunner.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
index a60a0f85487..404b8f6581b 100644
--- a/llvm/utils/lit/lit/TestRunner.py
+++ b/llvm/utils/lit/lit/TestRunner.py
@@ -787,9 +787,13 @@ def parseIntegratedTestScriptCommands(source_path, keywords):
# command. Note that we take care to return regular strings in
# Python 2, to avoid other code having to differentiate between the
# str and unicode types.
+ #
+ # Opening the file in binary mode prevented Windows \r newline
+ # characters from being converted to Unix \n newlines, so manually
+ # strip those from the yielded lines.
keyword,ln = match.groups()
yield (line_number, to_string(keyword.decode('utf-8')),
- to_string(ln.decode('utf-8')))
+ to_string(ln.decode('utf-8').rstrip('\r')))
finally:
f.close()
OpenPOWER on IntegriCloud