Internal error when encountering consecutive fmt: off's #1938
Labels
C: invalid code
Black destroyed a valid Python file
R: duplicate
This issue or pull request already exists
T: bug
Something isn't working
Describe the bug Black raises an internal error when it encounters a
# fmt: off
right after a# fmt: off
if there is a dedent between them.To Reproduce Steps to reproduce the behavior:
Expected behavior I would expect Black to exit with no error and no changes to the file. The first
# fmt: off
should have ended when the function returns, since there is a dedent.Environment (please complete the following information):
Does this bug also happen on master? Yes, according to https://black.now.sh/?version=master
Additional context Black works fine if you add lines
# fmt: on
after thepass
. However, my understanding is that this is implied by the dedent, and in any case should not produce an internal error in Black.The text was updated successfully, but these errors were encountered: