[llvm] 88aad9b - lit googletest.py: Don't raise StopIteration in generator

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 09:16:32 PDT 2020


Author: Hans Wennborg
Date: 2020-04-30T18:16:17+02:00
New Revision: 88aad9b9f05702585eb823d0188996f4cf62070a

URL: https://github.com/llvm/llvm-project/commit/88aad9b9f05702585eb823d0188996f4cf62070a
DIFF: https://github.com/llvm/llvm-project/commit/88aad9b9f05702585eb823d0188996f4cf62070a.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

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 777568b24465..67f32cf1cdf7 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-commits mailing list