From e34eb67a736c765cd1f858de80ff50157eda18bc Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Sat, 15 Dec 2018 12:32:45 +0100 Subject: Check isspace() before EOF in _parse_help() More common. isspace() returns False for empty strings. --- kconfiglib.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kconfiglib.py b/kconfiglib.py index 7ad76fd..b9264e4 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -2977,12 +2977,12 @@ class Kconfig(object): while 1: line = readline() - if not line: - break - if line.isspace(): # No need to preserve the exact whitespace in these add_line("\n") + elif not line: + # End of file + break else: expline = line.expandtabs() if len_(expline) - len_(expline.lstrip()) < indent: -- cgit v1.2.3