python: Fix toBool converter
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Thu, 19 Nov 2020 11:32:02 +0000 (11:32 +0000)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Fri, 20 Nov 2020 11:24:12 +0000 (11:24 +0000)
It was using an undefined variable (result) which was mistakenly left
there after its latest refactor

Change-Id: I50bb9b1e7793045556a29306faea5f455b29819d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/37755
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/python/m5/util/convert.py

index 077b6b4dc50ebc6327a5c7804692f265352a5081..d3088f603b59cf48f5ff846201c9c9039c5d50fa 100644 (file)
@@ -145,7 +145,7 @@ def toBool(value):
         return True
     if value in ('false', 'f', 'no', 'n', '0'):
         return False
-    return result
+    raise ValueError("cannot convert '%s' to bool" % value)
 
 def toFrequency(value):
     return toMetricFloat(value, 'frequency', 'Hz')