diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2015-06-16 18:01:07 +0200 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2015-06-16 18:01:07 +0200 |
| commit | e3299bbb0bbac402a658a15710b816b65657102a (patch) | |
| tree | 68d59c8692ec2dc62048655449a8d455d7cd518d | |
| parent | b7b5474954e3af31fd4da222a8d84795c917c136 (diff) | |
Simplify next_nonblank() a bit.
| -rw-r--r-- | kconfiglib.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/kconfiglib.py b/kconfiglib.py index 8379182..0afb7b6 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -3144,13 +3144,12 @@ class _FileFeed(object): self.linenr -= 1 def next_nonblank(self): - """Removes lines up to and including the next non-blank - (not all-space) line and returns it.""" + """Removes lines up to and including the next non-blank (not all-space) + line and returns it. Returns None if there are no more non-blank + lines.""" while 1: line = self.get_next() - if line is None: - return None - if not line.isspace(): + if line is None or not line.isspace(): return line def get_filename(self): |
