[llvm] r329972 - [lit] Remove duplicate to_string method

Aaron Smith via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 12 16:45:16 PDT 2018


Author: asmith
Date: Thu Apr 12 16:45:15 2018
New Revision: 329972

URL: http://llvm.org/viewvc/llvm-project?rev=329972&view=rev
Log:
[lit] Remove duplicate to_string method

There are two versions of to_string used by TestRunner.py. The one defined 
in TestRunner.py and the one defined in utils/lit/lit/util.py. The util.py
version is superior to the TestRunner.py version.

This change removes the duplicate to_string in TestRunner.py in favor of
always using the version from util.py. Beside removing duplicate code, this
makes it easier to debug TestRunner.py since only one version of to_string
is used.

Patch by Stella Stamenova!


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

Modified: llvm/trunk/utils/lit/lit/TestRunner.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestRunner.py?rev=329972&r1=329971&r2=329972&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/TestRunner.py (original)
+++ llvm/trunk/utils/lit/lit/TestRunner.py Thu Apr 12 16:45:15 2018
@@ -922,11 +922,6 @@ def _executeShCmd(cmd, shenv, results, t
         f.seek(0, 0)
         procData[i] = (procData[i][0], f.read())
 
-    def to_string(bytes):
-        if isinstance(bytes, str):
-            return bytes
-        return bytes.encode('utf-8')
-
     exitCode = None
     for i,(out,err) in enumerate(procData):
         res = procs[i].wait()




More information about the llvm-commits mailing list