vverbose: use capa.helpers.assert_never

typing.assert_never isn't available until py3.11
This commit is contained in:
Willi Ballenthin
2026-04-23 12:37:21 +03:00
committed by Willi Ballenthin
parent f5e3aa4a3b
commit dc4d64cb01

View File

@@ -14,7 +14,7 @@
import logging
import textwrap
from typing import Iterable, Optional, assert_never
from typing import Iterable, Optional
from rich.text import Text
from rich.table import Table
@@ -183,7 +183,7 @@ def render_statement(console: Console, layout: rd.Layout, match: rd.Match, state
console.writeln()
else:
assert_never(statement)
capa.helpers.assert_never(statement)
def render_string_value(s: str) -> str:
@@ -281,7 +281,7 @@ def render_node(console: Console, layout: rd.Layout, rule: rd.RuleMatches, match
elif isinstance(node, rd.FeatureNode):
render_feature(console, layout, rule, match, node.feature, indent=indent)
else:
assert_never(node)
capa.helpers.assert_never(node)
# display nodes that successfully evaluated against the sample.