Skip to content

Commit

Permalink
Use an assert
Browse files Browse the repository at this point in the history
Signed-off-by: RedGuy12 <61329810+RedGuy12@users.noreply.github.com>
  • Loading branch information
cobaltt7 committed Jan 24, 2024
1 parent 6ebdbd8 commit 18e67d2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/black/comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ def list_comments(prefix: str, *, is_endmarker: bool) -> List[ProtoComment]:
for index, full_line in enumerate(re.split("\r?\n", prefix)):
consumed += len(full_line) + 1 # adding the length of the split '\n'
match = re.match(r"^(\s*)(\S.*|)$", full_line)
whitespace, line = (" ", full_line) if match is None else match.groups()
assert match
whitespace, line = match.groups()
if not line:
nlines += 1
if "\f" in full_line:
Expand Down

0 comments on commit 18e67d2

Please sign in to comment.