Skip to content

Commit 5b25d53

Browse files
committed
Fix up AttributeError with TYPE_CHECKING
This will at least tamp down this particular error. Closes #212
1 parent 60e0aa3 commit 5b25d53

File tree

3 files changed

+876
-0
lines changed

3 files changed

+876
-0
lines changed

flake8_import_order/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ def _type_checking_import(self, node):
150150
)
151151
or (
152152
isinstance(node.parent.test, ast.Attribute)
153+
and isinstance(node.parent.test.value, ast.Name)
153154
and node.parent.test.value.id in {"t", "typing"}
154155
and getattr(node.parent.test, "attr", "") == "TYPE_CHECKING"
155156
)

0 commit comments

Comments
 (0)