Skip to content

Commit d24e6d7

Browse files
committed
[UpdateTestChecks] Apply some string concatenation cleanup
Some were what I suggested in D65610. llvm-svn: 368006
1 parent 757ac1f commit d24e6d7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

llvm/utils/update_test_checks.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -78,27 +78,27 @@ def main():
7878
test_paths = []
7979
for test in args.tests:
8080
if not glob.glob(test):
81-
print('WARNING: Test file \'%s\' was not found. Ignoring it.' % (test,), file=sys.stderr)
81+
print("WARNING: Test file '%s' was not found. Ignoring it." % (test,), file=sys.stderr)
8282
continue
8383
test_paths.append(test)
8484

8585
for test in test_paths:
8686
if args.verbose:
87-
print('Scanning for RUN lines in test file: %s' % (test,), file=sys.stderr)
87+
print('Scanning for RUN lines in test file: %s' + test, file=sys.stderr)
8888
with open(test) as f:
8989
input_lines = [l.rstrip() for l in f]
9090

9191
if args.update_only:
9292
if len(input_lines) == 0 or 'autogenerated' not in input_lines[0]:
93-
print('Skipping test which isn\'t autogenerated: %s' % (test), file=sys.stderr)
94-
continue;
93+
print("Skipping test which isn't autogenerated: " + test, file=sys.stderr)
94+
continue
9595

9696
raw_lines = [m.group(1)
9797
for m in [common.RUN_LINE_RE.match(l) for l in input_lines] if m]
9898
run_lines = [raw_lines[0]] if len(raw_lines) > 0 else []
9999
for l in raw_lines[1:]:
100-
if run_lines[-1].endswith("\\"):
101-
run_lines[-1] = run_lines[-1].rstrip("\\") + " " + l
100+
if run_lines[-1].endswith('\\'):
101+
run_lines[-1] = run_lines[-1].rstrip('\\') + ' ' + l
102102
else:
103103
run_lines.append(l)
104104

@@ -110,9 +110,9 @@ def main():
110110
prefix_list = []
111111
for l in run_lines:
112112
if '|' not in l:
113-
print('WARNING: Skipping unparseable RUN line: %s' % (l,), file=sys.stderr)
113+
print('WARNING: Skipping unparseable RUN line: ' + l, file=sys.stderr)
114114
continue
115-
115+
116116
(tool_cmd, filecheck_cmd) = tuple([cmd.strip() for cmd in l.split('|', 1)])
117117
common.verify_filecheck_prefixes(filecheck_cmd)
118118
if not tool_cmd.startswith(opt_basename + ' '):

0 commit comments

Comments
 (0)