lit googletest.py: Don't raise StopIteration in generator
authorHans Wennborg <hans@chromium.org>
Thu, 30 Apr 2020 13:03:22 +0000 (15:03 +0200)
committerHans Wennborg <hans@chromium.org>
Thu, 30 Apr 2020 16:16:17 +0000 (18:16 +0200)
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

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

index 777568b..67f32cf 100644 (file)
@@ -41,7 +41,7 @@ class GoogleTest(TestFormat):
             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.