Skip to content

Commit

Permalink
Fix crash on long empty string (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhail-melnik authored Feb 28, 2022
1 parent f1d1a53 commit d479f5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bugbear.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def gen_line_based_checks(self):
continue

length = len(line) - 1
if length > 1.1 * self.max_line_length:
if length > 1.1 * self.max_line_length and line.strip():
# Special case long URLS and paths to follow pycodestyle.
# Would use the `pycodestyle.maximum_line_length` directly but
# need to supply it arguments that are not available so chose
Expand Down
5 changes: 5 additions & 0 deletions tests/b950.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@

# This
# almost_empty_line_too_long

# Long empty line
"""
"""

0 comments on commit d479f5a

Please sign in to comment.