[llvm] b49d47f - Make lit TestRunner.py work in Python 3

Marcel Hlopko via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 22 02:44:14 PDT 2020


Author: Marcel Hlopko
Date: 2020-07-22T11:44:00+02:00
New Revision: b49d47f6a0f5bbf293e26d8b918cb46d80f2102f

URL: https://github.com/llvm/llvm-project/commit/b49d47f6a0f5bbf293e26d8b918cb46d80f2102f
DIFF: https://github.com/llvm/llvm-project/commit/b49d47f6a0f5bbf293e26d8b918cb46d80f2102f.diff

LOG: 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

Added: 
    

Modified: 
    llvm/utils/lit/lit/TestRunner.py

Removed: 
    


################################################################################
diff  --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
index a71cec2382ae..d80f0aeee8ce 100644
--- a/llvm/utils/lit/lit/TestRunner.py
+++ b/llvm/utils/lit/lit/TestRunner.py
@@ -1171,7 +1171,7 @@ def processLine(ln):
             # 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()


        


More information about the llvm-commits mailing list