Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 9, 2024
1 parent b37317a commit 2d55e99
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mypy/fastparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,13 @@ def parse_type_string(
"""
try:
try:
_, node = parse_type_comment(expr_string.strip(), line=line, column=column, errors=None)
_, node = parse_type_comment(
expr_string.strip(), line=line, column=column, errors=None
)
except SyntaxError:
_, node = parse_type_comment(f"({expr_string.strip()})", line=line, column=column, errors=None)
_, node = parse_type_comment(
f"({expr_string.strip()})", line=line, column=column, errors=None
)
if isinstance(node, UnboundType) and node.original_str_expr is None:
node.original_str_expr = expr_string
node.original_str_fallback = expr_fallback_name
Expand Down

0 comments on commit 2d55e99

Please sign in to comment.