From 02669243c44615852ab8b87c62ff0bdfd0e666dd Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Sat, 15 Dec 2018 13:54:34 +0100 Subject: Improve error for missing endchoice/endif/endmenu Say what was expected in the error message. --- kconfiglib.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kconfiglib.py b/kconfiglib.py index f12c9eb..ee78e5e 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -2731,7 +2731,12 @@ class Kconfig(object): # End of file reached. Terminate the final node and return it. if end_token: - raise KconfigError("Unexpected end of file " + self._filename) + raise KconfigError( + "expected '{}' at end of '{}'" + .format("endchoice" if end_token is _T_ENDCHOICE else + "endif" if end_token is _T_ENDIF else + "endmenu", + self._filename)) prev.next = None return prev -- cgit v1.2.3