From: Hugo Date: Thu, 2 May 2019 19:09:49 +0000 (+0300) Subject: Fix B011 (#820) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/597a0e102cce49a61b4bb01645f313bbbc86487e Fix B011 (#820) Do not call assert False since python -O removes these calls. Instead callers should raise AssertionError(). --- 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: