Use the regular conditional operator syntax instead of a clever hack.
[oota-llvm.git] / utils / lit / lit / TestRunner.py
index 3c2fe38473932270398d9f85390620046ea24e00..f653245b22e380dab19bf2f44e6744e29c1ff3dc 100644 (file)
@@ -522,10 +522,10 @@ def executeTclTest(test, litConfig):
     out,err,exitCode = res
     if isXFail:
         ok = exitCode != 0
-        status = (Test.XPASS, Test.XFAIL)[ok]
+        status = Test.XFAIL if ok else Test.XPASS
     else:
         ok = exitCode == 0
-        status = (Test.FAIL, Test.PASS)[ok]
+        status = Test.PASS if ok else Test.FAIL
 
     if ok:
         return (status,'')
@@ -558,10 +558,10 @@ def executeShTest(test, litConfig, useExternalSh):
     out,err,exitCode = res
     if isXFail:
         ok = exitCode != 0
-        status = (Test.XPASS, Test.XFAIL)[ok]
+        status = Test.XFAIL if ok else Test.XPASS
     else:
         ok = exitCode == 0
-        status = (Test.FAIL, Test.PASS)[ok]
+        status = Test.PASS if ok else Test.FAIL
 
     if ok:
         return (status,'')