https://github.com/psf/black/pull/4270 changed black.assert_equivalent to raise an ASTSafetyError exception (a custom exception inheriting from Exception) so catching AssertionError no longer works when developing with recent versions of black
This change makes the code compatible with older and newer versions of black.
coverage: 77.477%. remained the same
when pulling 17532048efda2af154d1baf45704fe9957f9b927 on fix-pre-commit-hook
into de90e941e50a8d7e5ff60cba60d299043d3353fa on main.
https://github.com/psf/black/pull/4270 changed
black.assert_equivalent
to raise anASTSafetyError
exception (a custom exception inheriting fromException
) so catchingAssertionError
no longer works when developing with recent versions ofblack
This change makes the code compatible with older and newer versions of
black
.