Skip to content

Commit

Permalink
fix bug introduced by psf/black#4270 where black.assert_equivalent
Browse files Browse the repository at this point in the history
…no longer raises an AssertionError
  • Loading branch information
spyoungtech committed May 11, 2024
1 parent 6bbcae5 commit 1753204
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .unasync-rewrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@

changes = 0

if hasattr(black, 'ASTSafetyError'):
exceptions = (AssertionError, black.ASTSafetyError)
else:
exceptions = (AssertionError,)


def _copyfunc(src, dst, *, follow_symlinks=True):
global changes
Expand All @@ -22,7 +27,7 @@ def _copyfunc(src, dst, *, follow_symlinks=True):
src=contents,
dst=dst_contents,
)
except AssertionError:
except exceptions:
changes += 1
print('MODIFIED', dst)
shutil.copy2(src, dst, follow_symlinks=follow_symlinks)
Expand Down

0 comments on commit 1753204

Please sign in to comment.