Skip to content

Commit

Permalink
Move get_proper_type section into try block with lookup_qualified
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordandev678 committed Sep 18, 2024
1 parent d72f74b commit c8ae0e9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mypy/checkexpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,15 +558,15 @@ def visit_call_expr_inner(self, e: CallExpr, allow_none_return: bool = False) ->
else:
try:
node = self.chk.lookup_qualified(e.args[0].name)
if node:
if isinstance(node.node, TypeAlias):
# Resolve type
typ = get_proper_type(node.node.target)
else:
typ = node.node.type
except KeyError:
# Undefined names should already be reported in semantic analysis.
pass
if node:
if isinstance(node.node, TypeAlias):
# Resolve type
typ = get_proper_type(node.node.target)
else:
typ = node.node.type
if (
typ is not None
and isinstance(typ, UnionType)
Expand Down

0 comments on commit c8ae0e9

Please sign in to comment.