[PATCH] D81361: Make lit TestRunner.py work in Python 3

Marcel Hlopko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 00:30:06 PDT 2020


hlopko created this revision.
Herald added subscribers: llvm-commits, delcypher.
Herald added a project: LLVM.
hlopko retitled this revision from "Make lit test runner work in python 3" to "Make lit TestRunner.py work in Python 3".
hlopko added a reviewer: gribozavr2.
hlopko edited the summary of this revision.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81361

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


Index: llvm/utils/lit/lit/TestRunner.py
===================================================================
--- llvm/utils/lit/lit/TestRunner.py
+++ llvm/utils/lit/lit/TestRunner.py
@@ -1171,7 +1171,7 @@
             # 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()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81361.269106.patch
Type: text/x-patch
Size: 600 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200608/62a894f1/attachment.bin>


More information about the llvm-commits mailing list