Skip to content

Commit

Permalink
Fix "variable possibly unbound" linting errors (#996)
Browse files Browse the repository at this point in the history
  • Loading branch information
FastestMolasses committed Oct 1, 2023
1 parent a42fb8e commit 14da892
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions loguru/_better_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ def _format_exception(
# on the indentation; the preliminary context for "SyntaxError" is always indented, while
# the Exception itself is not. This allows us to identify the correct index for the
# exception message.
error_message_index = 0
for error_message_index, part in enumerate(exception_only): # noqa: B007
if not part.startswith(" "):
break
Expand Down Expand Up @@ -504,6 +505,7 @@ def _format_exception(
yield from self._indent("".join(frames_lines), group_nesting)

if is_grouped:
exc = None
for n, exc in enumerate(value.exceptions, start=1):
ruler = "+" + (" %s " % ("..." if n > 15 else n)).center(35, "-")
yield from self._indent(ruler, group_nesting, prefix="+-" if n == 1 else " ")
Expand Down

0 comments on commit 14da892

Please sign in to comment.