From 465c1c1c9d7c102b4d35eb8c228565dbf8d35910 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 6 Apr 2022 11:03:13 +0200 Subject: [PATCH] remaining-gnu-error.py: simplify the code --- util/remaining-gnu-error.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/util/remaining-gnu-error.py b/util/remaining-gnu-error.py index 0209c6e67..5dbe120d4 100755 --- a/util/remaining-gnu-error.py +++ b/util/remaining-gnu-error.py @@ -15,11 +15,11 @@ urllib.request.urlretrieve( "result.json", ) -tests = glob.glob(base + "/*/*.sh") -tests_pl = glob.glob(base + "/*/*.pl") -tests_xpl = glob.glob(base + "/*/*.xpl") -tests = tests + tests_pl + tests_xpl +types = ("/*/*.sh", "/*/*.pl", "/*/*.xpl") +tests = [] +for files in types: + tests.extend(glob.glob(base + files)) # sort by size list_of_files = sorted(tests, key=lambda x: os.stat(x).st_size) @@ -38,11 +38,7 @@ for d in data: # the tests pass, we don't care anymore if data[d][e] == "PASS": - try: - list_of_files.remove(a) - except ValueError: - # Ignore the error - pass + list_of_files.remove(a) # Remove the factor tests and reverse the list (bigger first) tests = list(filter(lambda k: "factor" not in k, list_of_files))