8000 Don't crash when encountering an ast.Subscript node. · python-formate/flake8-encodings@049d54f · GitHub
[go: up one dir, main page]

Skip to content

Commit 049d54f

Browse files
committed
Don't crash when encountering an ast.Subscript node.
1 parent 64476ed commit 049d54f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

flake8_encodings/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,11 @@ def visit_Call(self, node: ast.Call): # noqa: D102
225225
# Expressions such as (tmp_pathplus / "code.py").write_text(example_source)
226226
return self.generic_visit(node)
227227

228+
elif isinstance(node.func.value, ast.Subscript): # pragma: no cover
229+
# TODO
230+
# Expressions such as my_list[0].run()
231+
return self.generic_visit(node)
232+
228233
elif self.filename.as_posix() == "<unknown>":
229234
# no jedi source (run with .visit() or from memory)
230235
return self.generic_visit(node)

0 commit comments

Comments
 (0)
0