[llvm-branch-commits] [llvm] 756b482 - lit googletest.py: Don't raise StopIteration in generator

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jun 16 12:28:27 PDT 2020


Author: Hans Wennborg
Date: 2020-06-16T12:27:51-07:00
New Revision: 756b482c69befb4ad5437a22fc5207711c4ccf4e

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

LOG: lit googletest.py: Don't raise StopIteration in generator

The intention here seems to be to end the generator function, but with
modern Python, raising StopIteration causes a runtime error
(https://www.python.org/dev/peps/pep-0479/).

Differential revision: https://reviews.llvm.org/D79169

(cherry picked from commit 88aad9b9f05702585eb823d0188996f4cf62070a)

Added: 
    

Modified: 
    llvm/utils/lit/lit/formats/googletest.py

Removed: 
    


################################################################################
diff  --git a/llvm/utils/lit/lit/formats/googletest.py b/llvm/utils/lit/lit/formats/googletest.py
index 6696fabc4f5e..2e07fa069d87 100644
--- a/llvm/utils/lit/lit/formats/googletest.py
+++ b/llvm/utils/lit/lit/formats/googletest.py
@@ -41,7 +41,7 @@ def getGTestTests(self, path, litConfig, localConfig):
             litConfig.warning(
                 "unable to discover google-tests in %r: %s. Process output: %s"
                 % (path, sys.exc_info()[1], exc.output))
-            raise StopIteration
+            return
 
         nested_tests = []
         for ln in output.splitlines(False):  # Don't keep newlines.


        


More information about the llvm-branch-commits mailing list