Fix B011 (#820)
Do not call assert False since python -O removes these calls. Instead callers should raise AssertionError().
This commit is contained in:
parent
acafdcb594
commit
597a0e102c
2
black.py
2
black.py
@ -3146,7 +3146,7 @@ def get_imports_from_children(children: List[LN]) -> Generator[str, None, None]:
|
||||
elif child.type == syms.import_as_names:
|
||||
yield from get_imports_from_children(child.children)
|
||||
else:
|
||||
assert False, "Invalid syntax parsing imports"
|
||||
raise AssertionError("Invalid syntax parsing imports")
|
||||
|
||||
for child in node.children:
|
||||
if child.type != syms.simple_stmt:
|
||||
|
Loading…
Reference in New Issue
Block a user