From e39ed552b69e95217864855332e6c883466a4548 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 6 Apr 2010 03:55:10 +0200 Subject: selftest: Remove python2.4-isms --- selftest/filter-subunit | 4 ++-- selftest/subunithelper.py | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/selftest/filter-subunit b/selftest/filter-subunit index 605a89840a..923d5cf3a3 100755 --- a/selftest/filter-subunit +++ b/selftest/filter-subunit @@ -26,9 +26,9 @@ parser.add_option("--prefix", type="string", opts, args = parser.parse_args() if opts.expected_failures: - expected_failures = list(subunithelper.read_test_regexes(opts.expected_failures)) + expected_failures = subunithelper.read_test_regexes(opts.expected_failures) else: - expected_failures = [] + expected_failures = {} statistics = { 'TESTS_UNEXPECTED_OK': 0, diff --git a/selftest/subunithelper.py b/selftest/subunithelper.py index 8659f984d8..2c5fa318c5 100644 --- a/selftest/subunithelper.py +++ b/selftest/subunithelper.py @@ -190,6 +190,7 @@ class SubunitOps(object): def read_test_regexes(name): + ret = {} f = open(name, 'r') try: for l in f: @@ -198,15 +199,16 @@ def read_test_regexes(name): continue if "#" in l: (regex, reason) = l.split("#", 1) - yield (regex.strip(), reason.strip()) + ret[regex.strip()] = reason.strip() else: - yield l, None + ret[l] = None finally: f.close() + return ret def find_in_list(regexes, fullname): - for regex, reason in regexes: + for regex, reason in regexes.iteritems(): if re.match(regex, fullname): if reason is None: return "" -- cgit