Skip to content

Commit 9298585

Browse files
committed
Make tests work with black 24.3.0
Closes: python-lsp#57 Black changed raising exception from AssertionError to ASTSafetyError and we need to apply similar change. See: psf/black@6af7d11
1 parent 56cc08c commit 9298585

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pylsp_black/plugin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def format_text(*, text, config, lines):
127127
IndentationError,
128128
# raised when black produces invalid Python code or formats the file
129129
# differently on the second pass
130-
AssertionError,
130+
black.parsing.ASTSafetyError,
131131
) as e:
132132
# errors will show on lsp stderr stream
133133
logger.error("Error formatting with black: %s", e)

0 commit comments

Comments
 (0)