diff options
Diffstat (limited to 'astroid/nodes/as_string.py')
-rw-r--r-- | astroid/nodes/as_string.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/astroid/nodes/as_string.py b/astroid/nodes/as_string.py index ace70909..cbd5ee17 100644 --- a/astroid/nodes/as_string.py +++ b/astroid/nodes/as_string.py @@ -588,7 +588,7 @@ class AsStringVisitor: def visit_matchclass(self, node: MatchClass) -> str: """Return an astroid.MatchClass node as string.""" if node.cls is None: - raise Exception(f"{node} does not have a 'cls' node") + raise AssertionError(f"{node} does not have a 'cls' node") class_strings: list[str] = [] if node.patterns: class_strings.extend(p.accept(self) for p in node.patterns) @@ -617,7 +617,7 @@ class AsStringVisitor: def visit_matchor(self, node: MatchOr) -> str: """Return an astroid.MatchOr node as string.""" if node.patterns is None: - raise Exception(f"{node} does not have pattern nodes") + raise AssertionError(f"{node} does not have pattern nodes") return " | ".join(p.accept(self) for p in node.patterns) # These aren't for real AST nodes, but for inference objects. |