]> granicus.if.org Git - llvm/commitdiff
[lit] Fix undefined symbol ArgumentError
authorBrian Gesiak <modocache@gmail.com>
Mon, 10 Oct 2016 01:19:27 +0000 (01:19 +0000)
committerBrian Gesiak <modocache@gmail.com>
Mon, 10 Oct 2016 01:19:27 +0000 (01:19 +0000)
Summary:
`ArgumentError` is not defined by the Python standard library.
Executing this line of code would throw a exception, but not the
intended one. It would throw a `NameError` exception, since `ArgumentError`
is undefined.

Use `ValueError` instead, which is defined by the Python standard
library.

Reviewers: echristo, delcypher, beanz, ddunbar

Subscribers: llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D25410

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283708 91177308-0d34-0410-b5e6-96231b3b80d8

utils/lit/lit/Test.py

index 9c9c47d63217a43414f81ccce0ba9cc53e2f12d2..657a7e8140d7aa498ddcedd470b67a40f0de662a 100644 (file)
@@ -189,9 +189,9 @@ class Test:
 
     def setResult(self, result):
         if self.result is not None:
-            raise ArgumentError("test result already set")
+            raise ValueError("test result already set")
         if not isinstance(result, Result):
-            raise ArgumentError("unexpected result type")
+            raise ValueError("unexpected result type")
 
         self.result = result