Do not call assert False since python -O removes these calls. Instead callers should raise AssertionError().
This commit is contained in:
Hugo 2019-05-02 22:09:49 +03:00 committed by Zsolt Dollenstein
parent acafdcb594
commit 597a0e102c

View File

@ -3146,7 +3146,7 @@ def get_imports_from_children(children: List[LN]) -> Generator[str, None, None]:
elif child.type == syms.import_as_names: elif child.type == syms.import_as_names:
yield from get_imports_from_children(child.children) yield from get_imports_from_children(child.children)
else: else:
assert False, "Invalid syntax parsing imports" raise AssertionError("Invalid syntax parsing imports")
for child in node.children: for child in node.children:
if child.type != syms.simple_stmt: if child.type != syms.simple_stmt: