From 597a0e102cce49a61b4bb01645f313bbbc86487e Mon Sep 17 00:00:00 2001 From: Hugo Date: Thu, 2 May 2019 22:09:49 +0300 Subject: [PATCH 1/1] Fix B011 (#820) Do not call assert False since python -O removes these calls. Instead callers should raise AssertionError(). --- black.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/black.py b/black.py index 0ea9b9a..234bfb5 100644 --- a/black.py +++ b/black.py @@ -3146,7 +3146,7 @@ def get_future_imports(node: Node) -> Set[str]: 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: -- 2.39.5