Commit 597a0e10 authored by Hugo's avatar Hugo Committed by Zsolt Dollenstein
Browse files

Fix B011 (#820)

Do not call assert False since python -O removes these calls. Instead callers should raise AssertionError(). 
parent acafdcb5
Loading
Loading
Loading
Loading
+1 −1
Changes for black.py: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -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: