diff --git a/codespell_lib/_codespell.py b/codespell_lib/_codespell.py index 8db03096108..693f078f321 100644 --- a/codespell_lib/_codespell.py +++ b/codespell_lib/_codespell.py @@ -881,7 +881,8 @@ def parse_file( ) for i, line in enumerate(lines): - if line.rstrip() in exclude_lines: + line = line.rstrip() + if not line or line in exclude_lines: continue extra_words_to_ignore = set()