From d6c182ee03c0992ae33f1233902a06f835a7cdc2 Mon Sep 17 00:00:00 2001 From: pm3512 Date: Sun, 7 May 2023 00:18:25 -0400 Subject: [PATCH] replaced class test with assertion --- vulture/core.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vulture/core.py b/vulture/core.py index 42074abf..a3068d6b 100644 --- a/vulture/core.py +++ b/vulture/core.py @@ -600,8 +600,7 @@ def _is_locals_call(node): @staticmethod def _is_subclass(node, class_name): """Return True if the node is a subclass of the given class.""" - if not isinstance(node, ast.ClassDef): - return False + assert isinstance(node, ast.ClassDef) for superclass in node.bases: if ( isinstance(superclass, ast.Name)