[llvm] r283708 - [lit] Fix undefined symbol ArgumentError

Brian Gesiak via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 9 18:19:27 PDT 2016


Author: modocache
Date: Sun Oct  9 20:19:27 2016
New Revision: 283708

URL: http://llvm.org/viewvc/llvm-project?rev=283708&view=rev
Log:
[lit] Fix undefined symbol ArgumentError

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

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

Modified: llvm/trunk/utils/lit/lit/Test.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/Test.py?rev=283708&r1=283707&r2=283708&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/Test.py (original)
+++ llvm/trunk/utils/lit/lit/Test.py Sun Oct  9 20:19:27 2016
@@ -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
 




More information about the llvm-commits mailing list