Skip to content

Commit

Permalink
Make tests work with black 24.3.0
Browse files Browse the repository at this point in the history
Closes: #57

Black changed raising exception from AssertionError to ASTSafetyError
and we need to apply similar change.

See: psf/black@6af7d11
  • Loading branch information
ancieg committed Apr 9, 2024
1 parent 56cc08c commit 9298585
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pylsp_black/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def format_text(*, text, config, lines):
IndentationError,
# raised when black produces invalid Python code or formats the file
# differently on the second pass
AssertionError,
black.parsing.ASTSafetyError,
) as e:
# errors will show on lsp stderr stream
logger.error("Error formatting with black: %s", e)
Expand Down

0 comments on commit 9298585

Please sign in to comment.