From 78b978686c5195fa9b4574c1285649872ea34a3e Mon Sep 17 00:00:00 2001 From: Jasjeet Rangi Date: Mon, 7 Nov 2022 15:09:24 -0800 Subject: [PATCH] stdlib: Fix get_isa_from_str() exception behavior in isas.py When given an input string that does not match any valid ISA, the get_isa_from_str() function should call get_isas_str_set() to to print the valid ISA strings in the exception. The current behavior is to recursively call get_isa_from_str() with no input, which prevents the correct exception from being raised. This change causes the correct exception to be raised for invalid inputs. Change-Id: I92bfe862bbd99ce0b63bfc124e539fab3b175e0c Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/65311 Maintainer: Bobby Bruce Reviewed-by: Bobby Bruce Tested-by: kokoro --- src/python/gem5/isas.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/gem5/isas.py b/src/python/gem5/isas.py index c904c9d227..84f02b87e7 100644 --- a/src/python/gem5/isas.py +++ b/src/python/gem5/isas.py @@ -81,7 +81,7 @@ def get_isa_from_str(input: str) -> ISA: return isa valid_isas_str_list = str() - for isa_str in get_isa_from_str(): + for isa_str in get_isas_str_set(): valid_isas_str_list += f"{os.linesep}{isa_str}" raise Exception(