summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-10-02 23:43:00 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2018-10-03 00:15:03 +0200
commit21e47ce43181ea6f460aa85e944c0bfad0672413 (patch)
tree6b115cc7f249166fe8de10db5ef8dd79070d5313
parent92ff1b9c4494fbba042b41efd21d1649052ce71e (diff)
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.
-rw-r--r--kconfiglib.py4
1 files 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