Black exceptions¶
Contents are subject to change.
-
exception
black.
CannotSplit
¶ A readable split that fits the allotted line length is impossible.
Raised by
left_hand_split()
,right_hand_split()
, anddelimiter_split()
.
-
exception
black.
FormatError
(consumed: int) → None¶ Base exception for # fmt: on and # fmt: off handling.
It holds the number of bytes of the prefix consumed before the format control comment appeared.
-
exception
black.
FormatOn
(consumed: int) → None¶ Found a comment like # fmt: on in the file.
-
exception
black.
FormatOff
(consumed: int) → None¶ Found a comment like # fmt: off in the file.
-
exception
black.
NothingChanged
¶ Raised by
format_file()
when reformatted code is the same as source.