summaryrefslogtreecommitdiff
path: root/kconfiglib.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-12-15 13:54:34 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2018-12-15 13:54:34 +0100
commit02669243c44615852ab8b87c62ff0bdfd0e666dd (patch)
treea6d2deb20aba18d5f6d73ec2ad9a25603c2c1fd4 /kconfiglib.py
parentd4929c497404fd1761d8351455a67e748c381d53 (diff)
Improve error for missing endchoice/endif/endmenu
Say what was expected in the error message.
Diffstat (limited to 'kconfiglib.py')
-rw-r--r--kconfiglib.py7
1 files changed, 6 insertions, 1 deletions
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