From ca89ca0c0c4207590d7ac6a38383d097e4b7c23f Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Wed, 20 Jun 2018 00:16:16 +0200 Subject: Rename KconfigSyntaxError to KconfigError This exception is generated for semantic errors and e.g. when dependency loops are detected as well, so the name is bad. Keep the old name as an alias for now for backwards compatibility. --- testsuite.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'testsuite.py') diff --git a/testsuite.py b/testsuite.py index 8f33736..bbb4c37 100644 --- a/testsuite.py +++ b/testsuite.py @@ -47,7 +47,7 @@ from kconfiglib import Kconfig, Symbol, Choice, COMMENT, MENU, MenuNode, \ escape, unescape, \ expr_str, expr_value, expr_items, split_expr, \ OR, AND, \ - KconfigSyntaxError + KconfigError import difflib import errno import os @@ -230,13 +230,13 @@ def run_selftests(): def verify_string_bad(s): """ - Verifies that tokenizing 's' throws a KconfigSyntaxError. Strips the - first and last characters from 's' so we can use readable raw strings - as input. + Verifies that tokenizing 's' throws a KconfigError. Strips the first + and last characters from 's' so we can use readable raw strings as + input. """ try: c.eval_string(s) - except KconfigSyntaxError: + except KconfigError: pass else: fail("expected tokenization of {} to fail, didn't".format(s[1:-1])) @@ -462,15 +462,15 @@ def run_selftests(): def verify_eval_bad(expr): try: c.eval_string(expr) - except KconfigSyntaxError: + except KconfigError: pass else: - fail('expected eval_string("{}") to throw KconfigSyntaxError, ' + fail('expected eval_string("{}") to throw KconfigError, ' "didn't".format(expr)) # The C implementation's parser can be pretty lax about syntax. Kconfiglib # sometimes needs to emulate that. Verify that some bad stuff throws - # KconfigSyntaxError at least. + # KconfigError at least. verify_eval_bad("") verify_eval_bad("&") verify_eval_bad("|") @@ -949,7 +949,7 @@ g try: Kconfig("Kconfiglib/tests/Krecursive1") - except KconfigSyntaxError: + except KconfigError: pass except: fail("recursive 'source' raised wrong exception") @@ -2003,7 +2003,7 @@ g filename = "Kconfiglib/tests/Kdeploop" + str(i) try: Kconfig(filename) - except KconfigSyntaxError as e: + except KconfigError as e: pass else: fail("dependency loop in {} not detected".format(filename)) -- cgit v1.2.3