diff --git a/flake8_stripe/flake8_stripe.py b/flake8_stripe/flake8_stripe.py index 62352de80..f394632be 100644 --- a/flake8_stripe/flake8_stripe.py +++ b/flake8_stripe/flake8_stripe.py @@ -126,13 +126,15 @@ def __init__(self, tree: ast.AST, filename: str): self.filename = filename def run(self) -> Iterator[Tuple[int, int, str, type]]: - if not self.filename.split('/')[-1].startswith("_"): + if not self.filename.split("/")[-1].startswith("_"): backcompat = False for node in ast.walk(self.tree): # check node is a constant string that contains package is deprecated - if (isinstance(node, ast.Constant) + if ( + isinstance(node, ast.Constant) and isinstance(node.value, str) - and "is deprecated" in node.value): + and "is deprecated" in node.value + ): backcompat = True if not backcompat: