Make lit TestRunner.py work in Python 3

Summary: In Python3 SubstituteCaptures are no longer converted to String implicitly behind the scenes. Converting explicitly makes the TestRunner to work in Python3.

Reviewers: gribozavr2, compnerd

Reviewed By: gribozavr2

Subscribers: tbkka, delcypher, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81361
This commit is contained in:
Marcel Hlopko 2020-07-22 10:34:53 +02:00
parent 5bb742b10d
commit b49d47f6a0
1 changed files with 1 additions and 1 deletions

View File

@ -1171,7 +1171,7 @@ def applySubstitutions(script, substitutions, recursion_limit=None):
# short-lived, since the set of substitutions is fairly small, and
# since thrashing has such bad consequences, not bounding the cache
# seems reasonable.
ln = _caching_re_compile(a).sub(b, ln)
ln = _caching_re_compile(a).sub(str(b), ln)
# Strip the trailing newline and any extra whitespace.
return ln.strip()