Skip to content

Commit

Permalink
code style
Browse files Browse the repository at this point in the history
  • Loading branch information
mhils committed Nov 9, 2022
1 parent d6cdf7c commit e3402cb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pyupgrade/_plugins/typing_pep604.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def visit_Subscript(
if not _supported_version(state):
return

# prevent rewriting forward annotations (unless they are about to be dequoted)
# prevent rewriting forward annotations (unless they will be dequoted)
has_forward_annotation = (
(sys.version_info >= (3, 9) and _any_arg_is_str(node.slice)) or
(
Expand All @@ -153,7 +153,10 @@ def visit_Subscript(
_any_arg_is_str(node.slice.value)
)
)
if has_forward_annotation and 'annotations' not in state.from_imports['__future__']:
if (
has_forward_annotation
and 'annotations' not in state.from_imports['__future__']
):
return

if is_name_attr(
Expand Down

0 comments on commit e3402cb

Please sign in to comment.