From 21e47ce43181ea6f460aa85e944c0bfad0672413 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Tue, 2 Oct 2018 23:43:00 +0200 Subject: Fix parse error message on the line after help texts The correct error and line number was reported, but not the correct line contents. self._line needs to be set before calling _tokenize(), so that _parse_error() knows the context. There's no need to set self._line for empty lines, because we immediately end up back in _next_line() after parsing the help text, which refetches the empty line and updates self._line. --- kconfiglib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kconfiglib.py b/kconfiglib.py index 15a92cd..03fffdb 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -1817,11 +1817,11 @@ class Kconfig(object): line = line[:-2] + self._file.readline() self._linenr += 1 + self._line = line + self._tokens = self._tokenize(line) self._reuse_tokens = True - self._line = line - # # Tokenization -- cgit v1.2.3