Skip to content

Commit

Permalink
Fix types.GenericAlias lookup crash
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Jul 20, 2024
1 parent 55a0812 commit 2ad4f48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mypy/checkexpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -4341,7 +4341,7 @@ def visit_index_with_type(
elif isinstance(left_type, FunctionLike) and left_type.is_type_obj():
if left_type.type_object().is_enum:
return self.visit_enum_index_expr(left_type.type_object(), e.index, e)
elif left_type.type_object().type_vars:
elif left_type.type_object().type_vars and self.chk.options.python_version >= (3, 9):
return self.named_type("types.GenericAlias")
elif (
left_type.type_object().fullname == "builtins.type"
Expand Down

0 comments on commit 2ad4f48

Please sign in to comment.